pthreadmutex
pthread_mutex is a POSIX threads synchronization primitive used to control access to shared data in multi-threaded programs. A mutex (mutual exclusion) allows only one thread at a time to execute a critical section protected by the mutex, preventing data races.
Usage: The mutex object can be statically initialized with PTHREAD_MUTEX_INITIALIZER or dynamically with pthread_mutex_init, which accepts
Mutex types and attributes: The type is defined by pthread_mutexattr_t. Standard types include PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_RECURSIVE,
Notes: The mutex must be unlocked by the thread that holds it; unlocking by a non-owner yields