Commit e3dee8e0 authored by unknown's avatar unknown

sync0sync.c Fix the infinite spin on FreeBSD

os0thread.c	Use pthread_yield instead of os_thread_sleep(0)


innobase/os/os0thread.c:
  Use pthread_yield instead of os_thread_sleep(0)
innobase/sync/sync0sync.c:
  Fix the infinite spin on FreeBSD
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parent 7a60014e
mwagner@evoq.mwagner.org
jcole@abel.spaceapes.com
monty@donna.mysql.fi
sasha@mysql.sashanet.com
heikki@donna.mysql.fi
......@@ -122,7 +122,7 @@ os_thread_yield(void)
#ifdef __WIN__
Sleep(0);
#else
os_thread_sleep(0);
pthread_yield();
#endif
}
......
......@@ -367,6 +367,15 @@ mutex_spin_wait(
return;
}
/* We may end up with a situation where lock_word is
0 but the OS fast mutex is still reserved. On FreeBSD
the OS does not seem to schedule a thread which is constantly
calling pthread_mutex_trylock (in mutex_test_and_set
implementation). Then we could end up spinning here indefinitely.
The following 'i++' stops this infinite spin. */
i++;
if (i < SYNC_SPIN_ROUNDS) {
goto spin_loop;
......
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