summaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-02-12 12:50:32 -0800
committerDavid 'Digit' Turner <digit@google.com>2010-02-12 12:50:32 -0800
commit4f920f685bb4af8400c70383eecf347a35353778 (patch)
treeb48d0f32e745f252a4ad5781e8da60f45415f7de /libc/bionic
parent294dd0b86b1484aec7549663aff5b19c98a4b7fd (diff)
downloadbionic-4f920f685bb4af8400c70383eecf347a35353778.zip
bionic-4f920f685bb4af8400c70383eecf347a35353778.tar.gz
bionic-4f920f685bb4af8400c70383eecf347a35353778.tar.bz2
Fix sem_post() behaviour to wake up multiple waiting threads.
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/semaphore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/bionic/semaphore.c b/libc/bionic/semaphore.c
index f4eebce..84b9314 100644
--- a/libc/bionic/semaphore.c
+++ b/libc/bionic/semaphore.c
@@ -180,7 +180,7 @@ int sem_post(sem_t *sem)
if (sem == NULL)
return EINVAL;
- if (__atomic_inc((volatile int*)&sem->count) == 0)
+ if (__atomic_inc((volatile int*)&sem->count) >= 0)
__futex_wake(&sem->count, 1);
return 0;