Skip to content

Commit

Permalink
[kernel] fix the AUTOUNSIGNAL path on kernel events to wait until a t…
Browse files Browse the repository at this point in the history
…hread waits on the event

in the case of it being signalled when there is no waiters pending.
  • Loading branch information
travis geiselbrecht authored and travisg committed Sep 18, 2008
1 parent eb94605 commit d98cea1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ status_t event_signal(event_t *e, bool reschedule)
if (!e->signalled) {
e->signalled = true;
if (e->flags & EVENT_FLAG_AUTOUNSIGNAL) {
/* release one thread and unsignal again */
wait_queue_wake_one(&e->wait, reschedule, NO_ERROR);
e->signalled = false;
/* try to release one thread and unsignal again if successful */
if (wait_queue_wake_one(&e->wait, reschedule, NO_ERROR) > 0)
e->signalled = false;
} else {
/* relase all threads and remain signalled */
/* release all threads and remain signalled */
wait_queue_wake_all(&e->wait, reschedule, NO_ERROR);
}
}
Expand Down

0 comments on commit d98cea1

Please sign in to comment.