This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fix for pthread_broadcast


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.


broadcastfix.patch

broadcastfix.ChangeLog


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]