< prev index next >
src/hotspot/share/utilities/concurrentHashTable.inline.hpp
Print this page
@@ -143,11 +143,11 @@
)
{
if (is_locked()) {
return false;
}
- if (Atomic::cmpxchg(node, &_first, expect) == expect) {
+ if (Atomic::cmpxchg(&_first, expect, node) == expect) {
return true;
}
return false;
}
@@ -158,11 +158,11 @@
if (is_locked()) {
return false;
}
// 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;
}
< prev index next >