Commit e8db9ca2 authored by osku's avatar osku

Forward port r123 from branches/5.0:

Replace goto in os_event_wait with a normal loop.
parent 7b1119ef
...@@ -317,7 +317,8 @@ os_event_wait( ...@@ -317,7 +317,8 @@ os_event_wait(
os_fast_mutex_lock(&(event->os_mutex)); os_fast_mutex_lock(&(event->os_mutex));
old_signal_count = event->signal_count; old_signal_count = event->signal_count;
loop:
for (;;) {
if (event->is_set == TRUE if (event->is_set == TRUE
|| event->signal_count != old_signal_count) { || event->signal_count != old_signal_count) {
...@@ -334,11 +335,10 @@ loop: ...@@ -334,11 +335,10 @@ loop:
pthread_cond_wait(&(event->cond_var), &(event->os_mutex)); pthread_cond_wait(&(event->cond_var), &(event->os_mutex));
/* Solaris manual said that spurious wakeups may occur: we have to /* Solaris manual said that spurious wakeups may occur: we
check if the event really has been signaled after we came here to have to check if the event really has been signaled after
wait */ we came here to wait */
}
goto loop;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment