src/hotspot/share/utilities/concurrentHashTable.inline.hpp
changeset 59252 623722a6aeb9
parent 59247 56bf71d64d51
--- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Mon Nov 25 12:33:15 2019 +0100
@@ -145,7 +145,7 @@
   if (is_locked()) {
     return false;
   }
-  if (Atomic::cmpxchg(node, &_first, expect) == expect) {
+  if (Atomic::cmpxchg(&_first, expect, node) == expect) {
     return true;
   }
   return false;
@@ -160,7 +160,7 @@
   }
   // We will expect a clean first pointer.
   Node* tmp = first();
-  if (Atomic::cmpxchg(set_state(tmp, STATE_LOCK_BIT), &_first, tmp) == tmp) {
+  if (Atomic::cmpxchg(&_first, tmp, set_state(tmp, STATE_LOCK_BIT)) == tmp) {
     return true;
   }
   return false;