[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: nptl 0.30
- From: "Alexander Terekhov" <terekhov web de>
- To: "NPTlibrarymailinglist" <phil-list redhat com>
- Subject: Re: nptl 0.30
- Date: Tue, 18 Mar 2003 15:53:23 +0100
"dada1" <dada1 cosmosbay com> schrieb am 18.03.03 13:55:32:
>
> I beg to differ Ulrich .
>
> May be Alexander was refering to the known futex_wake() with locked mutex
> symdrom :
I was referring to the pthread_cond_signal/broadcast(), mostly.
>
> File sysdeps/pthread/pthread_cond_wait.c, line 61
>
> lll_futex_wake (futex, INT_MAX);
> /* We are done. */
> lll_mutex_unlock (cbuffer->cond->__data.__lock);
>
>
> That means that the awaken thread(s) will hit the locked mutex.
>
> Just invert those lines to :
>
> lll_mutex_unlock (cbuffer->cond->__data.__lock); /* much better to call
> futex_wake() with the mutex unlocked */
> lll_futex_wake (futex, INT_MAX);
I think that it's sufficient to wake just one single thread
here (in cleanup() for async.cancel region "wrapping" futex
wait(); I guess).
regards,
alexander.
______________________________________________________________________________
Werden Sie kreativ! Jetzt HTML-Mails nicht nur schreiben - nein -
GESTALTEN, bei WEB.DE FreeMail! http://freemail.web.de/features/?mc=021141
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]