Concurrency (CON)
- CON50-CPP. Do not destroy a mutex while it is locked
- CON51-CPP. Ensure actively held locks are released on exceptional conditions
- CON52-CPP. Prevent data races when accessing bit-fields from multiple threads
- CON53-CPP. Avoid deadlock by locking in a predefined order
- CON54-CPP. Wrap functions that can spuriously wake up in a loop
- CON55-CPP. Preserve thread safety and liveness when using condition variables
- CON56-CPP. Do not speculatively lock a non-recursive mutex that is already owned by the calling thread
The following rules from the SEI CERT C Coding Standard also apply in C++:
- CON33-C. Avoid race conditions when using library functions
- CON37-C. Do not call signal() in a multithreaded program
- CON40-C. Do not refer to an atomic variable twice in an expression
- CON41-C. Wrap functions that can fail spuriously in a loop
- CON43-C. Do not allow data races in multithreaded code
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 |
|---|---|---|---|---|---|---|
| CON50-CPP | Medium | Probable | No | No | P4 | L3 |
| CON51-CPP | Low | Probable | Yes | Yes | P6 | L2 |
| CON52-CPP | Medium | Probable | No | No | P4 | L3 |
| CON53-CPP | Low | Probable | No | No | P2 | L3 |
| CON54-CPP | Low | Unlikely | Yes | No | P2 | L3 |
| CON55-CPP | Low | Unlikely | No | Yes | P2 | L3 |
| CON56-CPP | Low | Unlikely | No | No | P1 | L3 |


