diff -r c97db0855565 -r 758c07667682 src/share/vm/utilities/taskqueue.hpp --- a/src/share/vm/utilities/taskqueue.hpp Tue Feb 04 17:38:01 2020 +0800 +++ b/src/share/vm/utilities/taskqueue.hpp Tue Feb 04 18:13:14 2020 +0800 @@ -791,6 +791,11 @@ } else { // Otherwise, the queue contained exactly one element; we take the slow // path. + + // The barrier is required to prevent reordering the two reads of _age: + // one is the _age.get() below, and the other is _age.top() above the if-stmt. + // The algorithm may fail if _age.get() reads an older value than _age.top(). + OrderAccess::loadload(); return pop_local_slow(localBot, _age.get()); } }