Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.Phaser; public class JavaPhaserIsTerminatedExample1 { public static void main(String[] args) throws InterruptedException { Phaser p = new Phaser(); p.register(); System.out.println("Phaser Object is register..."); new JavaPhaserIsTerminatedExample1().test(p); new JavaPhaserIsTerminatedExample1().test(p); } private void test(final Phaser p) { new Thread(){ @Override public void run() { System.out.println(Thread.currentThread().getName()+" arrived"); System.out.println("Terminated: "+p.isTerminated()); } }.start(); } }
Output