POSIX thread library provides implementation of the mutex primitive, used for the mutual exclusion. Mutex is created using pthread_mutex_init, and destroyed using pthread_mutex_destroy. Obtaining a mutex can be done using pthread_mutex_lock or pthread_mutex_trylock, (depending if the timeout is desi...