Skip to content
Commit 694cd586 authored by Christopher Friedt's avatar Christopher Friedt Committed by Chris Friedt
Browse files

posix: pthread: fixes for coverity 321140 and 321092



The `pthread_once_lock` `k_mutex` is statically initialized and
only visible within file scope. Coverity identified it as unsafe
because the return values of `pthread_mutex_lock()` and
`pthread_mutex_unlock()` were unchecked. However, if those
functions were to fail here, it would be indicative that
something far worse has happened.

In any case, we add assertions that these functions
succeed rather than silently ignoring with `(void)`, which
ensures that we have coverage when assertions are enabled,
in test, while removing unneeded code with assertions disable,
in production.

Signed-off-by: default avatarChristopher Friedt <cfriedt@meta.com>
parent fed377f6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment