From: Francis Deslauriers Date: Mon, 30 Nov 2020 19:54:18 +0000 (-0500) Subject: Fix: missing `_mutex_lock()` before signaling a condition variable X-Git-Tag: v2.13.0-rc1~407 X-Git-Url: http://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=8db3acaf0eb2b0032c2ba25b038d37d166933fa6;hp=8db3acaf0eb2b0032c2ba25b038d37d166933fa6 Fix: missing `_mutex_lock()` before signaling a condition variable According to the PTHREAD_COND(3) man page, a condition variable signaling and broadcast should alway be protected with a mutex. This commit fixes two calls to `pthread_cond_signal()` function without holding the right lock. This commit also adds an assertion right before two calls to `pthread_cond_broadcast()` where it's less obvious from the surrounding code that the mutex is held. This documents the code and may be useful for future debugging. Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: Iebf5a8b2e4251bd1ff4cd462e548cd3486c6cb75 ---