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.
This commit is contained in:
Robert Collins 2001-09-30 14:39:55 +00:00
parent aab2a5da9e
commit 38102913c8
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
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.
Sat Sep 29 18:26:00 2001 Robert Collins <rbtcollins@hotmail.com>
* pthread.cc (pthread_cond_timedwait): Deleted - exported from thread.cc.

View File

@ -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);