src/hotspot/share/gc/shared/parallelCleaning.cpp
changeset 59252 623722a6aeb9
parent 57510 4db4d0d14390
child 59290 97d13893ec3c
--- a/src/hotspot/share/gc/shared/parallelCleaning.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/gc/shared/parallelCleaning.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -94,7 +94,7 @@
       }
     }
 
-  } while (Atomic::cmpxchg(last.method(), &_claimed_nmethod, first) != first);
+  } while (Atomic::cmpxchg(&_claimed_nmethod, first, last.method()) != first);
 }
 
 void CodeCacheUnloadingTask::work(uint worker_id) {
@@ -130,7 +130,7 @@
     return false;
   }
 
-  return Atomic::cmpxchg(1, &_clean_klass_tree_claimed, 0) == 0;
+  return Atomic::cmpxchg(&_clean_klass_tree_claimed, 0, 1) == 0;
 }
 
 InstanceKlass* KlassCleaningTask::claim_next_klass() {