Blame SOURCES/atomic_linux_zero.inline.hpp.patch

9bf359
diff --git a/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
9bf359
--- jdk8/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
9bf359
+++ jdk8/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
9bf359
@@ -222,31 +222,35 @@
9bf359
 
9bf359
 inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
9bf359
 #ifdef ARM
9bf359
-  return arm_lock_test_and_set(dest, exchange_value);
9bf359
+  jint result = arm_lock_test_and_set(dest, exchange_value);
9bf359
 #else
9bf359
 #ifdef M68K
9bf359
-  return m68k_lock_test_and_set(dest, exchange_value);
9bf359
+  jint result = m68k_lock_test_and_set(dest, exchange_value);
9bf359
 #else
9bf359
   // __sync_lock_test_and_set is a bizarrely named atomic exchange
9bf359
   // operation.  Note that some platforms only support this with the
9bf359
   // limitation that the only valid value to store is the immediate
9bf359
   // constant 1.  There is a test for this in JNI_CreateJavaVM().
9bf359
-  return __sync_lock_test_and_set (dest, exchange_value);
9bf359
+  jint result = __sync_lock_test_and_set (dest, exchange_value);
9bf359
+  __sync_synchronize();
9bf359
 #endif // M68K
9bf359
 #endif // ARM
9bf359
+  return result;
9bf359
 }
9bf359
 
9bf359
 inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value,
9bf359
                                  volatile intptr_t* dest) {
9bf359
 #ifdef ARM
9bf359
-  return arm_lock_test_and_set(dest, exchange_value);
9bf359
+  intptr_t result = arm_lock_test_and_set(dest, exchange_value);
9bf359
 #else
9bf359
 #ifdef M68K
9bf359
-  return m68k_lock_test_and_set(dest, exchange_value);
9bf359
+  intptr_t result = m68k_lock_test_and_set(dest, exchange_value);
9bf359
 #else
9bf359
-  return __sync_lock_test_and_set (dest, exchange_value);
9bf359
+  intptr_t result = __sync_lock_test_and_set (dest, exchange_value);
9bf359
+  __sync_synchronize();
9bf359
 #endif // M68K
9bf359
 #endif // ARM
9bf359
+  return result;
9bf359
 }
9bf359
 
9bf359
 inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) {