[JITLink][LoongArch] Support R_LARCH_ALIGN relaxation (#122259)
[llvm-project.git] / clang-tools-extra / docs / clang-tidy / checks / bugprone / spuriously-wake-up-functions.rst
blob1b5bab2143a2ddfe2676b8e34069d3cd9f77b99a
1 .. title:: clang-tidy - bugprone-spuriously-wake-up-functions
3 bugprone-spuriously-wake-up-functions
4 =====================================
6 Finds ``cnd_wait``, ``cnd_timedwait``, ``wait``, ``wait_for``, or
7 ``wait_until`` function calls when the function is not invoked from a loop
8 that checks whether a condition predicate holds or the function has a
9 condition parameter.
11 .. code-block:: c++
13     if (condition_predicate) {
14         condition.wait(lk);
15     }
17 .. code-block:: c
19     if (condition_predicate) {
20         if (thrd_success != cnd_wait(&condition, &lock)) {
21         }
22     }
24 This check corresponds to the CERT C++ Coding Standard rule
25 `CON54-CPP. Wrap functions that can spuriously wake up in a loop
26 <https://wiki.sei.cmu.edu/confluence/display/cplusplus/CON54-CPP.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop>`_.
27 and CERT C Coding Standard rule
28 `CON36-C. Wrap functions that can spuriously wake up in a loop
29 <https://wiki.sei.cmu.edu/confluence/display/c/CON36-C.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop>`_.