Lets say there are 3 threads A, B and C. And a mutex X
A calls pthread_mutex_lock on X.
B calls pthread_mutex_lock on X.
*
C calls pthread_mutex_lock on X.
A calls pthread_mutex_unlock on X.
**
Who will now be able to use the shared resource first? B or C? And what happens if I try to use pthread_destroy_mutex in *? in **?