diff options
author | rpj <rpj> | 2004-10-21 08:19:50 +0000 |
---|---|---|
committer | rpj <rpj> | 2004-10-21 08:19:50 +0000 |
commit | 5d4eb88954fa2402dcce06ccecde800da1c8703f (patch) | |
tree | 3362da76a993074e1876ed54f9745d8fbfe65992 /pthread_mutex_unlock.c | |
parent | da041b8ec0cfb1a70146e7f16459282f518bded6 (diff) |
Mutex logic fix
Diffstat (limited to 'pthread_mutex_unlock.c')
-rw-r--r-- | pthread_mutex_unlock.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pthread_mutex_unlock.c b/pthread_mutex_unlock.c index e28b38a..9b8e504 100644 --- a/pthread_mutex_unlock.c +++ b/pthread_mutex_unlock.c @@ -67,8 +67,13 @@ pthread_mutex_unlock (pthread_mutex_t * mutex) { if (idx < 0) { - /* Someone may be waiting on that mutex */ - if (SetEvent (mx->event) == 0) + /* + * Someone may be waiting on that mutex. + * Pulse event on an auto-reset event will + * release one waiter if possible, otherwise + * it will just reset the event. + */ + if (PulseEvent (mx->event) == 0) { result = EINVAL; } |