< prev index next >
src/hotspot/share/prims/jvmtiRawMonitor.cpp
Print this page
@@ -119,11 +119,11 @@
//
// -------------------------------------------------------------------------
void JvmtiRawMonitor::simple_enter(Thread* self) {
for (;;) {
- if (Atomic::replace_if_null(self, &_owner)) {
+ if (Atomic::replace_if_null(&_owner, self)) {
return;
}
QNode node(self);
self->_ParkEvent->reset(); // strictly optional
@@ -131,11 +131,11 @@
RawMonitor_lock->lock_without_safepoint_check();
node._next = _entry_list;
_entry_list = &node;
OrderAccess::fence();
- if (_owner == NULL && Atomic::replace_if_null(self, &_owner)) {
+ if (_owner == NULL && Atomic::replace_if_null(&_owner, self)) {
_entry_list = node._next;
RawMonitor_lock->unlock();
return;
}
RawMonitor_lock->unlock();
@@ -320,14 +320,14 @@
jt->SR_lock()->unlock();
jt->java_suspend_self();
jt->SR_lock()->lock_without_safepoint_check();
}
// guarded by SR_lock to avoid racing with new external suspend requests.
- contended = Atomic::cmpxchg(jt, &_owner, (Thread*)NULL);
+ contended = Atomic::cmpxchg(&_owner, (Thread*)NULL, jt);
jt->SR_lock()->unlock();
} else {
- contended = Atomic::cmpxchg(self, &_owner, (Thread*)NULL);
+ contended = Atomic::cmpxchg(&_owner, (Thread*)NULL, self);
}
if (contended == self) {
_recursions++;
return;
< prev index next >