Select the option that best describes this completed code. C…
Select the option that best describes this completed code. Create shared mutex lock and cond1 & cond2 condition variable and initialize//COMPLETION BEFORE EVEN PRINTpthread_mutex_lock(&mutex);while (counter %2 != 0) pthread_cond_wait(&cond1,&mutex);//COMPLETION AFTER EVEN PRINTpthread_cond_signal(&cond2);pthread_mutex_unlock(&mutex);//COMPLETION BEFORE ODD PRINTpthread_mutex_lock(&mutex);while (counter %2 == 0) pthread_cond_wait(&cond2,&mutex);//COMPLETION AFTER ODD PRINTpthread_cond_signal(&cond1);pthread_mutex_unlock(&mutex);
Read Details