Re: problems with pthread_cond_broadcast

Thorsten Kukuk <[email protected]> Thu, 15 Apr 2004 09:48:42 +0200
Newsgroups gmane.comp.lib.phil
Organization SuSE Linux AG, Nuernberg, Germany
Message-ID <[email protected]>
On Thu, Apr 15, Scott Lamb wrote:

> I think there is a problem in your test case. And I _sort_of_ see it. 
> Imagine this sequence of events:
> 
> Thread 1            Thread 2
> ----------------------------------------
> rw_lock_write:      rw_lock_write:
>   mutex_lock
>   n_readers = -1
>   mutex_unlock
>                       mutex_lock
>                       n_readers != 0
> rw_unlock_write:
>   mutex_lock

At this place, two threads would have mutex_lock. That should
not happen and I don't see how it can happen.

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        [email protected]
SuSE Linux AG        Maxfeldstr. 5                 D-90409 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B