summaryrefslogtreecommitdiff
path: root/innobase/include/sync0sync.ic
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-05-26 21:58:59 +0300
committerunknown <heikki@donna.mysql.fi>2001-05-26 21:58:59 +0300
commit860d2b392a542f42ad60e12382fced1068c04c20 (patch)
treebf62d04e36a4bbb5ec3fa445cca8e6c5ecf95f57 /innobase/include/sync0sync.ic
parent714640bfb9f725f05567c58fac34612e3e99df33 (diff)
downloadmariadb-git-860d2b392a542f42ad60e12382fced1068c04c20.tar.gz
sync0sync.ic InnoDB now uses XCHG to implement mutex if GCC and x86
configure.in InnoDB now uses XCHG to implement mutex if GCC and x86 innobase/configure.in: InnoDB now uses XCHG to implement mutex if GCC and x86 innobase/include/sync0sync.ic: InnoDB now uses XCHG to implement mutex if GCC and x86 BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'innobase/include/sync0sync.ic')
-rw-r--r--innobase/include/sync0sync.ic14
1 files changed, 14 insertions, 0 deletions
diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic
index a937ac5d579..e23e2b68e14 100644
--- a/innobase/include/sync0sync.ic
+++ b/innobase/include/sync0sync.ic
@@ -86,6 +86,20 @@ mutex_test_and_set(
/* mutex_fence(); */
return(res);
+#elif defined(__GNUC__) && defined(UNIV_INTEL_X86)
+ ulint* lw;
+ ulint res;
+
+ lw = &(mutex->lock_word);
+
+ /* In assembly we use the so-called AT & T syntax where
+ the order of operands is inverted compared to the ordinary Intel
+ syntax. The 'l' after the mnemonics denotes a 32-bit operation. */
+
+ asm volatile("movl $1, %%eax; xchgl (%%ecx), %%eax" :
+ "=eax" (res):
+ "ecx" (lw));
+ return(res);
#else
ibool ret;