8274773: [TESTBUG] UnsafeIntrinsicsTest intermittently fails on weak memory model platform

Reviewed-by: eosterlund, goetz
This commit is contained in:
Martin Doerr 2021-10-11 10:31:54 +00:00
parent c032186b42
commit 49f8ce6e9c

View File

@ -289,6 +289,7 @@ class Runner implements Runnable {
private Node mergeImplLoad(Node startNode, Node expectedNext, Node head) {
// Atomic load version
Node temp = (Node) UNSAFE.getReference(startNode, offset);
UNSAFE.storeFence(); // Make all new Node fields visible to concurrent readers.
startNode.setNext(head);
return temp;
}