8229169: False failure of GenericTaskQueue::pop_local on architectures with weak memory model jdk8u242-b02

Wed, 07 Aug 2019 17:00:19 +0800

author
jiefu
date
Wed, 07 Aug 2019 17:00:19 +0800
changeset 9784
775e2bf92114
parent 9783
14b0d7d60628
child 9785
ee19c358e3b8
child 9787
9f28a4cac6d9

8229169: False failure of GenericTaskQueue::pop_local on architectures with weak memory model
Reviewed-by: mdoerr, kbarrett, tschatzl

src/share/vm/utilities/taskqueue.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/utilities/taskqueue.hpp	Sat Aug 03 09:04:04 2019 +0800
     1.2 +++ b/src/share/vm/utilities/taskqueue.hpp	Wed Aug 07 17:00:19 2019 +0800
     1.3 @@ -714,6 +714,11 @@
     1.4    } else {
     1.5      // Otherwise, the queue contained exactly one element; we take the slow
     1.6      // path.
     1.7 +
     1.8 +    // The barrier is required to prevent reordering the two reads of _age:
     1.9 +    // one is the _age.get() below, and the other is _age.top() above the if-stmt.
    1.10 +    // The algorithm may fail if _age.get() reads an older value than _age.top().
    1.11 +    OrderAccess::loadload();
    1.12      return pop_local_slow(localBot, _age.get());
    1.13    }
    1.14  }

mercurial