Commit 5a54f862 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com
Browse files

semaphore.c:

  semaphore fix
parent f503efea
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;