From eb4a8af559cae9374d29617053a1113ac4b7de2e Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Mon, 8 Mar 2021 20:11:18 +0000 Subject: [PATCH] 8260664: Phaser.arrive() memory consistency effects Reviewed-by: dl --- .../share/classes/java/util/concurrent/Phaser.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/java.base/share/classes/java/util/concurrent/Phaser.java b/src/java.base/share/classes/java/util/concurrent/Phaser.java index 9c4f2a57f86..e5dee8b4494 100644 --- a/src/java.base/share/classes/java/util/concurrent/Phaser.java +++ b/src/java.base/share/classes/java/util/concurrent/Phaser.java @@ -148,6 +148,12 @@ import java.util.concurrent.locks.LockSupport; * returns snapshots of these state queries in a form convenient for * informal monitoring. * + *

Memory consistency effects: Actions prior to any form of arrive + * method + * happen-before a corresponding phase advance and + * onAdvance actions (if present), which in turn happen-before + * actions following the phase advance. + * *

Sample usages: * *

A {@code Phaser} may be used instead of a {@code CountDownLatch}