Code example for CyclicBarrier

Methods: await

0
	public Connection call() throws Exception {
		semaphore.acquire();
		Connection con=JDBCUtil.getConnection();
		count++;
		System.out.println("waitin");
		cyclicBarrier.await();
		semaphore.release();
		System.out.println("released");
		return con;
	} 
	public void closeConnection(Connection con){
		try { 
			con.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
		try { 
			Thread.currentThread().sleep(100);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block