Java Phaser isTerminated() Method

The isTerminated() method is of Phaser class. This method returns true if phaser has been terminated.

Syntax

Return

It returns true if phaser is terminated. Otherwise, it returns false.

Example 1

Test it Now

Output:

Phaser Object is register...
Thread-0 arrived
Thread-1 arrived
Terminated: false
Terminated: false

Example 2

Test it Now

Output:

Phaser Object is register...
Thread-0 arrived
Terminated: false
Thread-1 arrived
Thread-2 arrived
Thread-3 arrived
Terminated: false
Terminated: false
Thread-4 arrived
Terminated: false
Terminated: false
Thread-5 arrived
Terminated: false

Next TopicJava Phaser




Latest Courses