Question: Does the following code guarantee (a) mutex, (b) no unnecessary delay, (c) fairness void thr_exit() { Pthread_mutex_lock(&m); Pthread_cond_signal(&c); Pthread_mutex_unlock(&m); } void thr_join() { Pthread_mutex_lock(&m); Pthread_cond_wait(&c,
Does the following code guarantee (a) mutex, (b) no unnecessary delay, (c) fairness void thr_exit() { Pthread_mutex_lock(&m); Pthread_cond_signal(&c); Pthread_mutex_unlock(&m); } void thr_join() { Pthread_mutex_lock(&m); Pthread_cond_wait(&c, &m); Pthread_mutex_unlock(&m); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
