diff options
author | unknown <serg@serg.mysql.com> | 2002-06-21 19:20:56 +0000 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2002-06-21 19:20:56 +0000 |
commit | 03b770f31e40c16b75d38a1ee416c0e4049ee597 (patch) | |
tree | 5da59957d8a8e365a9c30acd9e07caaab4f00bc0 | |
parent | 584815d9e8bea6c19bd268d7f855619bba1a3098 (diff) | |
download | mariadb-git-03b770f31e40c16b75d38a1ee416c0e4049ee597.tar.gz |
semaphore.c:
semaphore fix
mit-pthreads/pthreads/semaphore.c:
semaphore fix
-rw-r--r-- | mit-pthreads/pthreads/semaphore.c | 4 |
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; |