sqc 0.4.13

Software Code Quality - CERT C compliance checker
[metadata]
id = "POS04-C"
type = "recommendation"
category = "POS"
number = 4
title = "Avoid using PTHREAD_MUTEX_NORMAL type mutex locks"
description = """
Pthread mutual exclusion (mutex) locks are used to avoid simultaneous usage of
common resources. Several types of mutex locks are defined by
pthreads:NORMAL,ERRORCHECK,RECURSIVE, andDEFAULT. POSIX
describesPTHREAD_MUTEX_NORMALlocks as having the following undefined behavior
[Open Group 2004]: TheDEFAULTmutex pthread is also generally mapped
toPTHREAD_MUTEX_NORMALbut is known to vary from platform to platform [SOL 2010].
Consequently,NORMALlocks should not be used, andERRORCHECKorRECURSIVElocks
should be defined explicitly when mutex locks are used.
"""
severity = "Low"
likelihood = "Unlikely"
priority = "P3"
level = "L3"
cert_version = "2016 Edition (Wiki)"
last_modified = "Oct 31, 2025"

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

[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/POS04-C.+Avoid+using+PTHREAD_MUTEX_NORMAL+type+mutex+locks"