From: Tim-Philipp Müller Date: Sun, 6 Jul 2014 11:13:04 +0000 (+0100) Subject: libs: gstcheck: check that mutex is locked before g_cond_wait*() is called X-Git-Tag: 1.3.91~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba31faf261c5747808378c50818eef34712156d1;p=platform%2Fupstream%2Fgstreamer.git libs: gstcheck: check that mutex is locked before g_cond_wait*() is called Sanity check to catch problems in unit test. --- diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h index 0d3d4a1..84d1d11 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); \