--- old/src/hotspot/share/gc/shared/parallelCleaning.cpp 2019-11-21 11:57:24.667225407 +0100 +++ new/src/hotspot/share/gc/shared/parallelCleaning.cpp 2019-11-21 11:57:24.167216960 +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() {