diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-10-31 18:07:02 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-10-31 18:07:02 -0400 |
commit | 4d1511296288782df0e3d9373396724e250b24c1 (patch) | |
tree | 9fa47d141b71933859d6c2da585e5bb5e52db212 /storage/innobase/include/sync0sync.ic | |
parent | 17b0b45b1de41a1b188c5de6c3e9d8e6ecc48a72 (diff) | |
parent | d775ecdd010daad4dc6147fba58acd006bf2c60c (diff) | |
download | mariadb-git-4d1511296288782df0e3d9373396724e250b24c1.tar.gz |
Merge tag 'mariadb-10.0.22' into 10.0-galera
Diffstat (limited to 'storage/innobase/include/sync0sync.ic')
-rw-r--r-- | storage/innobase/include/sync0sync.ic | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic index a5887b1fd6f..149c81a3788 100644 --- a/storage/innobase/include/sync0sync.ic +++ b/storage/innobase/include/sync0sync.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -74,13 +74,13 @@ Performs an atomic test-and-set instruction to the lock_word field of a mutex. @return the previous value of lock_word: 0 or 1 */ UNIV_INLINE -byte +lock_word_t ib_mutex_test_and_set( -/*===============*/ +/*==================*/ ib_mutex_t* mutex) /*!< in: mutex */ { #if defined(HAVE_ATOMIC_BUILTINS) - return(os_atomic_test_and_set_byte_acquire(&mutex->lock_word, 1)); + return(os_atomic_test_and_set(&mutex->lock_word)); #else ibool ret; @@ -95,7 +95,7 @@ ib_mutex_test_and_set( } return((byte) ret); -#endif +#endif /* HAVE_ATOMIC_BUILTINS */ } /******************************************************************//** @@ -108,15 +108,12 @@ mutex_reset_lock_word( ib_mutex_t* mutex) /*!< in: mutex */ { #if defined(HAVE_ATOMIC_BUILTINS) - /* 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. */ - os_atomic_test_and_set_byte_release(&mutex->lock_word, 0); + os_atomic_clear(&mutex->lock_word); #else mutex->lock_word = 0; - os_fast_mutex_unlock_full_barrier(&(mutex->os_fast_mutex)); -#endif + os_fast_mutex_unlock(&(mutex->os_fast_mutex)); +#endif /* HAVE_ATOMIC_BUILTINS */ } /******************************************************************//** |