Index: mariadb-5.5-5.5.36/storage/xtradb/include/sync0sync.ic
===================================================================
--- mariadb-5.5-5.5.36.orig/storage/xtradb/include/sync0sync.ic	2014-08-20 11:52:49.864584117 +0100
+++ mariadb-5.5-5.5.36/storage/xtradb/include/sync0sync.ic	2014-08-20 11:52:49.854583916 +0100
@@ -80,7 +80,7 @@
 	mutex_t*	mutex)	/*!< in: mutex */
 {
 #if defined(HAVE_ATOMIC_BUILTINS)
-	return(os_atomic_test_and_set_byte(&mutex->lock_word, 1));
+	return(os_acquire_test_and_set_byte(&mutex->lock_word, 1));
 #else
 	ibool	ret;
 
@@ -111,7 +111,7 @@
 	/* 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(&mutex->lock_word, 0);
+	os_release_byte(&mutex->lock_word, 0);
 #else
 	mutex->lock_word = 0;
 
Index: mariadb-5.5-5.5.36/storage/xtradb/include/os0sync.h
===================================================================
--- mariadb-5.5-5.5.36.orig/storage/xtradb/include/os0sync.h	2014-08-20 11:52:49.864584117 +0100
+++ mariadb-5.5-5.5.36/storage/xtradb/include/os0sync.h	2014-08-20 11:52:49.854583916 +0100
@@ -314,9 +314,12 @@
 /**********************************************************//**
 Returns the old value of *ptr, atomically sets *ptr to new_val */
 
-# define os_atomic_test_and_set_byte(ptr, new_val) \
+# define os_acquire_test_and_set_byte(ptr, new_val) \
 	__sync_lock_test_and_set(ptr, (byte) new_val)
 
+# define os_release_byte(ptr, new_val) \
+	__sync_lock_release(ptr, (byte) new_val)
+
 #elif defined(HAVE_IB_SOLARIS_ATOMICS)
 
 # define HAVE_ATOMIC_BUILTINS
Index: mariadb-5.5-5.5.36/storage/innobase/include/os0sync.h
===================================================================
--- mariadb-5.5-5.5.36.orig/storage/innobase/include/os0sync.h	2014-03-01 23:37:11.000000000 +0000
+++ mariadb-5.5-5.5.36/storage/innobase/include/os0sync.h	2014-08-20 11:55:55.048292949 +0100
@@ -307,9 +307,12 @@
 /**********************************************************//**
 Returns the old value of *ptr, atomically sets *ptr to new_val */
 
-# define os_atomic_test_and_set_byte(ptr, new_val) \
+# define os_acquire_test_and_set_byte(ptr, new_val) \
 	__sync_lock_test_and_set(ptr, (byte) new_val)
 
+# define os_release_byte(ptr, new_val) \
+	__sync_lock_release(ptr, (byte) new_val)
+
 #elif defined(HAVE_IB_SOLARIS_ATOMICS)
 
 #define HAVE_ATOMIC_BUILTINS
Index: mariadb-5.5-5.5.36/storage/innobase/include/sync0sync.ic
===================================================================
--- mariadb-5.5-5.5.36.orig/storage/innobase/include/sync0sync.ic	2014-03-01 23:37:11.000000000 +0000
+++ mariadb-5.5-5.5.36/storage/innobase/include/sync0sync.ic	2014-08-20 11:55:02.877248028 +0100
@@ -80,7 +80,7 @@
 	mutex_t*	mutex)	/*!< in: mutex */
 {
 #if defined(HAVE_ATOMIC_BUILTINS)
-	return(os_atomic_test_and_set_byte(&mutex->lock_word, 1));
+	return(os_acquire_test_and_set_byte(&mutex->lock_word, 1));
 #else
 	ibool	ret;
 
@@ -111,7 +111,7 @@
 	/* 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(&mutex->lock_word, 0);
+	os_release_byte(&mutex->lock_word, 0);
 #else
 	mutex->lock_word = 0;
 
