摘要:
/*..Onesolutiontothereleasing-requestproblem*///thisisa'non-releasing'routinerequestingreleasing routine_a(){mutex_lock(mutex); // ...mutex_lock(mutex_r); flag=1;request();// notify the releasorcond_wait(cond_r,mutex_r);flag=0; mutex_unlock(mutex_r); // ...mutex_unlock(mutex);}//thisisthe 阅读全文