[concurrency-interest] Re: Backport condition variablesand reentrant locks.

Dawid Kurzyniec dawidk at mathcs.emory.edu
Thu Aug 11 16:51:24 EDT 2005

Alexander Terekhov wrote:

>You better include an incarnation of pthread_mutex_setlockcount_np() and
>let your
>clients shoot themselves in the foot.
I am not sure I follow; what I meant was: the JSR 166 conditional 
variables work with reentrant variables, so should the backport version. 
The current backport implementation of await() simply releases the lock 
once, and then reacquires it once, which leads to the erroneous behavior 
when the thread has multiple holds. The fix I am going to make is for 
await() to release all holds, remembering how many there were, and then 
reacquire all of them before returning. That's how Object.wait() behaves 
for built-in locks.


More information about the Concurrency-interest mailing list