Detects when a mutex is used before it’s initialized.
This check detects anytime pthread_mutex_lock(_:) or pthread_mutex_unlock(_:) is called with a pthread_mutex_t variable that wasn’t initialized. Attempting to use an uninitialized mutex results in an error, and removes any guarantees about ordering that would exist while a mutex is locked.
Use of Uninitialized Mutex in C
In the following example, the pthread_mutex_lock(_:) function is called on an uninitialized pthread_mutex_t variable.
Use the pthread_once(_:_:) function to ensure that initialization is called before a mutex is used.