Threads trying to acquire pthread_mutex_lock(&mutex) What happens if they don't get the lock?

C Programming:

What happens when a thread tries to acquire a mutex lock, and fails to get it?

Does it go to sleep?

Will the thread be woken up when pthread_mutex_unlock(&mutex); is called?

Then try to obtain the lock again?

6
задан Bobby S 11 March 2011 в 00:53
поделиться