--- old/src/hotspot/share/prims/jvmtiRawMonitor.cpp 2018-01-04 02:53:30.385648131 -0500 +++ new/src/hotspot/share/prims/jvmtiRawMonitor.cpp 2018-01-04 02:53:29.997628267 -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 ;