changeset 56465:4e3a26572bb6

Merge
author valeriep
date Wed, 07 Aug 2019 20:47:43 +0000
parents 24f1a593dcd0 167cb7b4cd81
children b948b920e29f
files
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shared/taskqueue.inline.hpp	Wed Aug 07 20:46:28 2019 +0000
+++ b/src/hotspot/share/gc/shared/taskqueue.inline.hpp	Wed Aug 07 20:47:43 2019 +0000
@@ -184,6 +184,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());
   }
 }