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

Alexander Terekhov TEREKHOV at de.ibm.com
Thu Aug 11 16:32:41 EDT 2005

You better include an incarnation of pthread_mutex_setlockcount_np() and
let your
clients shoot themselves in the foot.


Sent by:    concurrency-interest-bounces at cs.oswego.edu

To:    Maciej Szefler <mbs at fivesight.com>
cc:    concurrency-interest at altair.cs.oswego.edu
Subject:    [concurrency-interest] Re: Backport condition variables and
       reentrant locks.

Maciej Szefler wrote:

>Great job with the backport, its  a life saver. However, I have recently
>run into a problem. It seems that the condition variables do not work as
>advertised with reentrant locks. I find that if a thread has multiple
>holds on a reentrant lock a conditional variable await() call will only
>release one of those holds.  This is contrary to expectations (at least
>mine and the JavaDoc author's).
You are right. This is a bug. Conditional variables in the backport were
derived from dl.util.concurrent.CondVar, which was POSIX-style
condition, supposed to work with non-reentrant mutexes. It should be
easy to fix; I will include the fix in the next release (probably 2-3
weeks from now).


Concurrency-interest mailing list
Concurrency-interest at altair.cs.oswego.edu

More information about the Concurrency-interest mailing list