GitHub
CERT Secure Coding

Concurrency (CON)

Information for Editors
To have a new guideline automatically listed above be sure to label it con and rule .

Risk Assessment Summary

Rule Severity Likelihood Detectable Repairable Priority Level
CON30-C Medium Unlikely No No P2 L3
CON31-C Medium Probable No No P4 L3
CON32-C Medium Probable No No P4 L3
CON33-C Medium Probable No No P4 L3
CON34-C Medium Probable No No P4 L3
CON35-C Low Probable No No P2 L3
CON36-C Low Unlikely Yes No P2 L3
CON37-C Low Probable Yes No P4 L3
CON38-C Low Unlikely No Yes P2 L3
CON39-C Low Likely No No P3 L3
CON40-C Medium Probable Yes No P8 L2
CON41-C Low Unlikely Yes No P2 L3
CON43-C Medium Probable No No P4 L3
13. Concurrency (CON)
CON04-C. Join or detach threads even if their exit status is unimportant
CON30-C. Clean up thread-specific storage
CON31-C. Do not destroy a mutex while it is locked
CON32-C. Prevent data races when accessing bit-fields from multiple threads
CON33-C. Avoid race conditions when using library functions
CON34-C. Declare objects shared between threads with appropriate storage durations
CON35-C. Avoid deadlock by locking in a predefined order
CON37-C. Do not call signal() in a multithreaded program
CON43-C. Do not allow data races in multithreaded code
CON50-CPP. Do not destroy a mutex while it is locked
POS04-C. Avoid using PTHREAD_MUTEX_NORMAL type mutex locks
POS44-C. Do not use signals to terminate threads
POS47-C. Do not use threads that can be canceled asynchronously
POS48-C. Do not unlock or destroy another POSIX thread's mutex
POS49-C. When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed
POS50-C. Declare objects shared between POSIX threads with appropriate storage durations
POS51-C. Avoid deadlock with POSIX threads by locking in predefined order
POS53-C. Do not use more than one mutex for concurrent waiting operations on a condition variable
VOID CON04-CPP. Ensure objects are fully initialized before allowing access
VOID CON30-CPP. Ensure all threads exit before exiting main
VOID POS05-C. Avoid race conditions with multiple POSIX threads
VOID POS06-C. Acquire and release POSIX synchronization primitives in the same module, at the same level of abstraction
VOID POS41-C. When a POSIX thread exit status is not of concern, pthread_detach() or an equivalent function must be used
VOID POS53-C. Do not use more than one mutex for concurrent waiting operations on a condition variable with POSIX threads
WIN01-C. Do not forcibly terminate execution