diff options
author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2018-09-07 11:47:06 -0400 |
---|---|---|
committer | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2018-09-07 16:37:47 -0400 |
commit | 2271b75fa9019a9ba10d38ea2cf53a2032b1d8fd (patch) | |
tree | a8fd73afcb4cafbc7223803408a571737648b930 /tests/tpm-emu.h | |
parent | 19b599f7664b2ebfd0f405fb79c14dd241557452 (diff) |
tests: Fix signalling race condition in TPM tests
This patch fixes a race condition and test failure where the main process
waits for the signal of a thread but the thread already sent that signal
via a condition. Since these signals are non-sticky, we need to introduce a
separate variable to make this signal sticky.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'tests/tpm-emu.h')
-rw-r--r-- | tests/tpm-emu.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/tpm-emu.h b/tests/tpm-emu.h index 08f902485e..8eb802a79e 100644 --- a/tests/tpm-emu.h +++ b/tests/tpm-emu.h @@ -26,6 +26,7 @@ struct tpm_hdr { typedef struct TestState { GMutex data_mutex; GCond data_cond; + bool data_cond_signal; SocketAddress *addr; QIOChannel *tpm_ioc; GThread *emu_tpm_thread; |