brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 1b5bab2 Raw
30 lines · plain
1.. title:: clang-tidy - bugprone-spuriously-wake-up-functions2 3bugprone-spuriously-wake-up-functions4=====================================5 6Finds ``cnd_wait``, ``cnd_timedwait``, ``wait``, ``wait_for``, or7``wait_until`` function calls when the function is not invoked from a loop8that checks whether a condition predicate holds or the function has a9condition parameter.10 11.. code-block:: c++12 13    if (condition_predicate) {14        condition.wait(lk);15    }16 17.. code-block:: c18 19    if (condition_predicate) {20        if (thrd_success != cnd_wait(&condition, &lock)) {21        }22    }23 24This check corresponds to the CERT C++ Coding Standard rule25`CON54-CPP. Wrap functions that can spuriously wake up in a loop26<https://wiki.sei.cmu.edu/confluence/display/cplusplus/CON54-CPP.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop>`_.27and CERT C Coding Standard rule28`CON36-C. Wrap functions that can spuriously wake up in a loop29<https://wiki.sei.cmu.edu/confluence/display/c/CON36-C.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop>`_.30