--- a/src/hotspot/share/prims/jvmtiRawMonitor.cpp Wed Jan 03 17:29:20 2018 +0000
+++ b/src/hotspot/share/prims/jvmtiRawMonitor.cpp Thu Jan 04 18:18:18 2018 -0500
@@ -127,7 +127,7 @@
int JvmtiRawMonitor::SimpleEnter (Thread * Self) {
for (;;) {
- if (Atomic::cmpxchg(Self, &_owner, (void*)NULL) == NULL) {
+ if (Atomic::replace_if_null(Self, &_owner)) {
return OS_OK ;
}
@@ -139,7 +139,7 @@
Node._next = _EntryList ;
_EntryList = &Node ;
OrderAccess::fence() ;
- if (_owner == NULL && Atomic::cmpxchg(Self, &_owner, (void*)NULL) == NULL) {
+ if (_owner == NULL && Atomic::replace_if_null(Self, &_owner)) {
_EntryList = Node._next ;
RawMonitor_lock->unlock() ;
return OS_OK ;