Java Phaser awaitAdvance() Method

The awaitAdvance() Method is of Phaser Class. In this method, the current phaser arrives in advance from the given phase value,

Syntax

Parameters

phase - phase number on which it arrives.

Return

It returns the next phase number on which it will arrive.

Example 1

Test it Now

Output:

Phaser Object is register...
Initial Phase count is 0
Thread awaitAdvance : 0
Thread-0 arrived

Example 2

Test it Now

Output:

Phaser Object is register...
Thread-1 arrived
Thread awaitAdvance : 0
Thread-2 arrived
Thread-3 arrived
Thread-0 arrived
Thread-4 arrived

Next TopicJava Phaser




Latest Courses