Fix: missing `_mutex_lock()` before signaling a condition variable
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 30 Nov 2020 19:54:18 +0000 (14:54 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Dec 2020 02:16:06 +0000 (21:16 -0500)
commit8db3acaf0eb2b0032c2ba25b038d37d166933fa6
tree80fbe58e04e9968290099f4dd81d2ea0616d4d03
parentd0e263e7e628d2eba76c883ffc6fb92065e440c7
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 <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Iebf5a8b2e4251bd1ff4cd462e548cd3486c6cb75
src/bin/lttng-sessiond/action-executor.c
src/bin/lttng-sessiond/session.c
src/common/ust-consumer/ust-consumer.c
This page took 0.026395 seconds and 5 git commands to generate.