svn commit: r233103 - head/lib/libthr/thread

David Xu listlog2011 at gmail.com
Tue Mar 20 00:07:51 UTC 2012


On 2012/3/20 1:50, John Baldwin wrote:
> http://pubs.opengroup.org/onlinepubs/007904975/functions/pthread_cond_destroy.html
> This is quite different as assuming a broadcast marks all the threads as runnable
> and removes them from the cv's queue, none of the threads will have references to
> the cv so it will be safe to destroy.  It would not be safe to destroy the mutex
> in that case though (and the example does not destroy the mutex, only the cv).
>
Also an implementation based on sequence number to detect broadcast will 
suffer
from the problem because it needs to recheck the sequence number after 
unblocking
to make sure it is not a spurious wakeup or a signal sent to the thread 
which
makes it return to user mode.




More information about the svn-src-head mailing list