summaryrefslogtreecommitdiff
path: root/innobase/sync
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-04-04 16:30:46 +0300
committerunknown <heikki@donna.mysql.fi>2001-04-04 16:30:46 +0300
commite3dee8e0f123c61c0ea48e1bd0310d86f21c6c26 (patch)
tree7c4564440560ba7a27b10f4802fc1a67b3fa7fc1 /innobase/sync
parent7a60014eff6f448f723366f1a1f97859f0a0ac3e (diff)
downloadmariadb-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/sync')
-rw-r--r--innobase/sync/sync0sync.c9
1 files changed, 9 insertions, 0 deletions
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) {