diff options
author | unknown <heikki@donna.mysql.fi> | 2001-04-04 16:30:46 +0300 |
---|---|---|
committer | unknown <heikki@donna.mysql.fi> | 2001-04-04 16:30:46 +0300 |
commit | e3dee8e0f123c61c0ea48e1bd0310d86f21c6c26 (patch) | |
tree | 7c4564440560ba7a27b10f4802fc1a67b3fa7fc1 /innobase | |
parent | 7a60014eff6f448f723366f1a1f97859f0a0ac3e (diff) | |
download | mariadb-git-e3dee8e0f123c61c0ea48e1bd0310d86f21c6c26.tar.gz |
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
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/os/os0thread.c | 2 | ||||
-rw-r--r-- | innobase/sync/sync0sync.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c index 2664d574122..c1519ac58e4 100644 --- a/innobase/os/os0thread.c +++ b/innobase/os/os0thread.c @@ -122,7 +122,7 @@ os_thread_yield(void) #ifdef __WIN__ Sleep(0); #else - os_thread_sleep(0); + pthread_yield(); #endif } diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c index b98b22dd90b..a27dc74c2fb 100644 --- a/innobase/sync/sync0sync.c +++ b/innobase/sync/sync0sync.c @@ -366,6 +366,15 @@ spin_loop: 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) { |