src/hotspot/share/gc/shared/taskqueue.cpp
changeset 59252 623722a6aeb9
parent 59221 cc3a82fc7bcb
--- a/src/hotspot/share/gc/shared/taskqueue.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/gc/shared/taskqueue.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -244,7 +244,7 @@
       return true;
     }
     expected_value = current_offered;
-  } while ((current_offered = Atomic::cmpxchg(current_offered - 1, &_offered_termination, current_offered)) != expected_value);
+  } while ((current_offered = Atomic::cmpxchg(&_offered_termination, current_offered, current_offered - 1)) != expected_value);
 
   assert(_offered_termination < _n_threads, "Invariant");
   return false;