pthread_mutex_init(&mutex, 0);
pthread_cond_init(&cond, NULL);
UNSET_ALL_LOCKS(this);
+ unset_owner();
value = init_value;
trace = 0;
}
value = 0;
else
value--;
+ if( !value )
+ set_owner();
pthread_mutex_unlock(&mutex);
}
value = 1;
else
value++;
+ unset_owner();
pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
}
else
--value;
}
+ if( !value )
+ set_owner();
pthread_mutex_unlock(&mutex);
return result;
}