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 <[EMAIL PROTECTED]>
 * 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

Reply via email to