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.


_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to