Code example for CyclicBarrier

Methods: await

0
			service.execute(new Runnable() {
				 
				public void run() { 
					System.out.println("barrier start");
					try { 
						barrier.await();
					} catch (InterruptedException e) {
						e.printStackTrace();
					} catch (BrokenBarrierException e) {
						e.printStackTrace();
					} 
				} 
			});			 
		} 
 
	} 
	 
	public static void main(String[] args){
		CyclicBarrierDemo demo = new CyclicBarrierDemo();
		demo.testBarrier();
	}