diff options
author | Robert Collins <rbtcollins@hotmail.com> | 2001-09-30 18:39:55 +0400 |
---|---|---|
committer | Robert Collins <rbtcollins@hotmail.com> | 2001-09-30 18:39:55 +0400 |
commit | 38102913c804196b69ffd4d60e5631f082c5a66e (patch) | |
tree | 5f13c7971a2017dddcc663e17c1304405906ec1b /winsup/cygwin/thread.cc | |
parent | aab2a5da9e2055b99595aa9fe238bb5c824fd737 (diff) |
Mon Oct 1 00:34:00 2001 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (pthread_cond_dowait): Hopefully eliminate a race on multiple thread
wakeups.
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r-- | winsup/cygwin/thread.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index c952bd774..8b6f1b6d6 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -1773,8 +1773,8 @@ __pthread_cond_dowait (pthread_cond_t *cond, pthread_mutex_t *mutex, bool last = false; if (InterlockedDecrement (&((*cond)->waiting)) == 0) last = true; - (*cond)->mutex->Lock (); - if (last) + (*themutex)->Lock (); + if (last == true) (*cond)->mutex = NULL; if (pthread_mutex_lock (&(*cond)->cond_access)) system_printf ("Failed to lock condition variable access mutex, this %0p\n", *cond); |