RFR: JDK-8314194: Reusing CyclicBarrier, it should be possible to change the barrierCommand

chenggwang duke at openjdk.org
Wed Aug 30 11:07:10 UTC 2023


On Fri, 11 Aug 2023 02:33:05 GMT, chenggwang <duke at openjdk.org> wrote:

> Sorry, my description in Issue JDK-8314194(which I submitted) is ambiguous and makes you think of Phaser. My intention is that each generation of CyclicBarrier barrierCommand can change. Let me give you a scenario
> For example, the U.S. Army 'Gordon Sullivan Cup'.
> Five tanks competing.
> 1. The first round is for artillery strikes against targets.
> 2. Second round of anti-aircraft machine gun targets.
> 3. The third round is minefield racing.
> The scoring criteria are different for each round, so the CyclicBarrier's barrierCommand should be different for each round. But in the current code, `private final Runnable barrierCommand`, constructing the CyclicBarrier instance is already determined to be unchangeable.

@vicente-romero-oracle  @albertnetymk  Hi, can you take a look at this PR for me?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15239#issuecomment-1698950580


More information about the core-libs-dev mailing list