summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2002-06-21 19:20:56 +0000
committerunknown <serg@serg.mysql.com>2002-06-21 19:20:56 +0000
commit3efb1f9d958e880731adaa5f4761da529e042a84 (patch)
tree5da59957d8a8e365a9c30acd9e07caaab4f00bc0
parent8d902b942d4a69701ace758dacb0d8789cc2460c (diff)
downloadmariadb-git-3efb1f9d958e880731adaa5f4761da529e042a84.tar.gz
semaphore.c:
semaphore fix mit-pthreads/pthreads/semaphore.c: semaphore fix
-rw-r--r--mit-pthreads/pthreads/semaphore.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mit-pthreads/pthreads/semaphore.c b/mit-pthreads/pthreads/semaphore.c
index 5516af1f4e3..0af54beca8a 100644
--- a/mit-pthreads/pthreads/semaphore.c
+++ b/mit-pthreads/pthreads/semaphore.c
@@ -32,7 +32,9 @@ int sem_destroy(sem_t * sem)
int sem_wait(sem_t * sem)
{
- while ((errno=pthread_mutex_lock(&sem->mutex)) || !sem->count)
+ if ((errno=pthread_mutex_lock(&sem->mutex)))
+ return -1;
+ while (!sem->count)
pthread_cond_wait(&sem->cond, &sem->mutex);
if (errno)
return -1;