src/hotspot/share/code/nmethod.cpp
changeset 48488 51825789dd89
parent 48486 bda5211e7876
child 48608 1dab70e20292
--- a/src/hotspot/share/code/nmethod.cpp	Wed Jan 03 17:29:20 2018 +0000
+++ b/src/hotspot/share/code/nmethod.cpp	Thu Jan 04 18:18:18 2018 -0500
@@ -1625,7 +1625,7 @@
   assert(nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called");
   if (_oops_do_mark_link == NULL) {
     // Claim this nmethod for this thread to mark.
-    if (Atomic::cmpxchg(NMETHOD_SENTINEL, &_oops_do_mark_link, (nmethod*)NULL) == NULL) {
+    if (Atomic::replace_if_null(NMETHOD_SENTINEL, &_oops_do_mark_link)) {
       // Atomically append this nmethod (now claimed) to the head of the list:
       nmethod* observed_mark_nmethods = _oops_do_mark_nmethods;
       for (;;) {