0
如何用條件變量替換下面的忙等待?用條件變量替換忙等待
while (this_thread != pthread_self()){
pthread_mutex_lock(&lock);
if(this_thread == -1)
this_thread = get_id();
pthread_mutex_unlock(&lock);
}
謝謝!
如何設置由'get_id()'返回的值? – alk