From: Paul Floyd Date: Fri, 18 Apr 2025 18:37:12 +0000 (+0200) Subject: Doc: add description of cond signal without mutex lock. X-Git-Tag: VALGRIND_3_25_0~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d497c30fc6398a4b3aee92231749ac4072c7de3b;p=thirdparty%2Fvalgrind.git Doc: add description of cond signal without mutex lock. --- diff --git a/helgrind/docs/hg-manual.xml b/helgrind/docs/hg-manual.xml index 6ec8caa3f4..398fd73a70 100644 --- a/helgrind/docs/hg-manual.xml +++ b/helgrind/docs/hg-manual.xml @@ -141,6 +141,15 @@ are: Checks pertaining to the validity of mutexes are generally also performed for reader-writer locks. +Signalling or broadcasting a condition variable when the +associated mutex is unlocked is not strictly an error. The resulting +thread scheduling may be unpredictable if the mutex is not held. +The option --check-cond-signal-mutex=yes|no +turns on checking for this situation. This kind of error is +categorised as 'dubious'. The check is not turned on by default +because some standard C and C++ libraries use condition +signals/broadcasts with the associated mutex unlocked. + Various kinds of this-can't-possibly-happen events are also reported. These usually indicate bugs in the system threading library.