fix for pthread_broadcast

Robert Collins robert.collins@itdomain.com.au
Sun May 6 00:23:00 GMT 2001


pthread_broadcast was broken. This patch fixes it for the testcase
reported by Greg Smith. I've also introduced per-cond variable locking
to make broadcasts atomic. There are still races present, however the
worst case is an occasional dropped signal. (And note that to trigger
the race, the users code must be such that the signal could be missed
_anyway_ ).

Rob

Sun May  6 17:05:00 2001  Robert Collins <rbtcollins@hotmail.com>
 * thread.h (pthread_cond): New element cond_access to allow atomic
broadcasts.
 * thread.cc (pthread_cond::pthread_cond): Initialise cond_access.
 (pthread_cond::~pthread_cond): Destroy cond_access.
 (pthread_cond::Broadcast): Use cond_access.
 (pthread_cond::Signal): Use cond_access.
 (pthread_cond_wait): Use cond_access.
 (pthread_cond_timedwait): Use cond_access.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: broadcastfix.ChangeLog
Type: text/x-diff
Size: 865 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20010506/5d816424/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broadcastfix.patch
Type: text/x-diff
Size: 6470 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20010506/5d816424/attachment-0001.bin>


More information about the Cygwin-patches mailing list