There are two threads: the dbus thread and the tpm thread. The dbus thread is responsible for handling incoming DBus method calls and posting them onto the TPM thread; it also handles the
GetStatus API call and reads of TPM properties. We use dbus-c++ to generate adaptors and handle method calls. The flow when a method is called is this:
To do this, we have to use dbus-c++ in its special ‘async adaptor’ mode, which makes it generate wrappers that can defer returning their results; we hand the required continuation (called a ‘tag’) to the tpm thread to use in its reply.