Skip to content

Commit

Permalink
Fix a couple of bugs in the posix semaphore implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tavip committed Sep 13, 2007
1 parent cac2641 commit 5c32b4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ void linux_enter_idle(void)

pthread_sigmask(SIG_BLOCK, &sigmask, NULL);
pthread_mutex_lock(&idle_sem.lock);
if (idle_sem.count <= 0)
while (idle_sem.count <= 0)
pthread_cond_wait(&idle_sem.cond, &idle_sem.lock);
idle_sem.count--;
pthread_mutex_unlock(&idle_sem.lock);
pthread_sigmask(SIG_UNBLOCK, &sigmask, NULL);
}
Expand Down

0 comments on commit 5c32b4d

Please sign in to comment.