This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
fix for pthread_broadcast
- To: <cygwin-patches at cygwin dot com>
- Subject: fix for pthread_broadcast
- From: "Robert Collins" <robert dot collins at itdomain dot com dot au>
- Date: Sun, 6 May 2001 17:13:25 +1000
- Cc: "greg smith" <gsmith at nc dot rr dot com>
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