diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2014-07-06 12:13:04 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2014-07-06 12:13:04 +0100 |
commit | ba31faf261c5747808378c50818eef34712156d1 (patch) | |
tree | 0a0603ebcffc39ff50c0d7339215d07d96c7ac3b | |
parent | b2bbd1edfadcb1852753c2b911040606698c9ee1 (diff) |
libs: gstcheck: check that mutex is locked before g_cond_wait*() is called
Sanity check to catch problems in unit test.
-rw-r--r-- | libs/gst/check/gstcheck.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h index 0d3d4a17a..84d1d11dd 100644 --- a/libs/gst/check/gstcheck.h +++ b/libs/gst/check/gstcheck.h @@ -484,6 +484,8 @@ G_STMT_START { \ G_STMT_START { \ /* synchronize everyone */ \ GST_DEBUG ("THREAD %p: syncing", g_thread_self ()); \ + fail_if (g_mutex_trylock (&mutex), \ + "bug in unit test, mutex should be locked at this point");\ g_cond_wait (&sync_cond, &mutex); \ GST_DEBUG ("THREAD %p: synced", g_thread_self ()); \ g_mutex_unlock (&mutex); \ |