Forward port r123 from branches/5.0:

Replace goto in os_event_wait with a normal loop.
This commit is contained in:
osku 2006-01-12 09:20:15 +00:00
parent 1cae280896
commit 86e48ce5f9

View file

@ -317,28 +317,28 @@ os_event_wait(
os_fast_mutex_lock(&(event->os_mutex));
old_signal_count = event->signal_count;
loop:
if (event->is_set == TRUE
|| event->signal_count != old_signal_count) {
os_fast_mutex_unlock(&(event->os_mutex));
for (;;) {
if (event->is_set == TRUE
|| event->signal_count != old_signal_count) {
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
os_fast_mutex_unlock(&(event->os_mutex));
os_thread_exit(NULL);
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
os_thread_exit(NULL);
}
/* Ok, we may return */
return;
}
/* Ok, we may return */
return;
pthread_cond_wait(&(event->cond_var), &(event->os_mutex));
/* Solaris manual said that spurious wakeups may occur: we
have to check if the event really has been signaled after
we came here to wait */
}
pthread_cond_wait(&(event->cond_var), &(event->os_mutex));
/* Solaris manual said that spurious wakeups may occur: we have to
check if the event really has been signaled after we came here to
wait */
goto loop;
#endif
}