...
The C++ Standard, [thread.mutex.class], paragraph 5 [ISO/IEC 14882-2014], states:
The behavior of a program is undefined if it destroys a
mutex
object owned by any thread or a thread terminates while owning amutex
object.
...
MITRE CWE | CWE-667, Improper Locking |
SEI CERT C Coding Standard | CON31-C. Do not destroy a mutex while it is locked |
Bibliography
[ISO/IEC 14882-2014] | Subclause 30.4.1, "Mutex Requirements" |
...