mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Merge port of Google SMP patch to Solaris
This commit is contained in:
parent
e21ed0a83e
commit
090bcb74ab
14 changed files with 78 additions and 51 deletions
|
|
@ -88,8 +88,9 @@ mutex_test_and_set(
|
|||
/* mutex_fence(); */
|
||||
|
||||
return(res);
|
||||
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
|
||||
return __sync_lock_test_and_set(&(mutex->lock_word), 1);
|
||||
#elif defined(MY_ATOMIC_NOLOCK)
|
||||
return ((byte)my_atomic_swap8(
|
||||
(int8 volatile *)&(mutex->lock_word), 1));
|
||||
#else
|
||||
ibool ret;
|
||||
|
||||
|
|
@ -126,11 +127,11 @@ mutex_reset_lock_word(
|
|||
__asm MOV EDX, 0
|
||||
__asm MOV ECX, lw
|
||||
__asm XCHG DL, BYTE PTR [ECX]
|
||||
#elif defined(HAVE_GCC_ATOMIC_BUILTINS)
|
||||
#elif defined(MY_ATOMIC_NOLOCK)
|
||||
/* In theory __sync_lock_release should be used to release the lock.
|
||||
Unfortunately, it does not work properly alone. The workaround is
|
||||
that more conservative __sync_lock_test_and_set is used instead. */
|
||||
__sync_lock_test_and_set(&(mutex->lock_word), 0);
|
||||
(void)my_atomic_swap8((int8 volatile *)&(mutex->lock_word), 0);
|
||||
#else
|
||||
mutex->lock_word = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue