sqc 0.4.13

Software Code Quality - CERT C compliance checker
[metadata]
id = "CON31-C"
type = "recommendation"
category = "CON"
number = 31
title = "Do not destroy a mutex while it is locked"
description = """
Mutexes are used to protect shared data structures being concurrently accessed.
If a mutex is destroyed while a thread is blocked waiting for that
mutex,critical sectionsand shared data are no longer protected. The C Standard,
7.28.4.1, paragraph 2 [ISO/IEC 9899:2024], states This statement implies that
destroying a mutex while a thread is waiting on it isundefined behavior.
"""
severity = "Medium"
likelihood = "Probable"
priority = "P4"
level = "L3"
cert_version = "2016 Edition (Wiki)"
last_modified = "May 05, 2025"

[rules.cert_c.CON31-C]
enabled = true

[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/CON31-C.+Do+not+destroy+a+mutex+while+it+is+locked"
cwe = ["CWE-667"]