Code example for CyclicBarrier

Methods: await

0
    try { 
      if (index < MAX_BUF) {
        bytesWritten[index] = (byte) i;
        index++;
        if(i == EOL) {
          barrier.await(1, TimeUnit.SECONDS);
        } 
      } else { 
        barrier.await(1, TimeUnit.SECONDS);
      } 
    } catch (Exception e) {
      throw new IOException("Could not await on barrier:"+e.getMessage(),e);
    } 
  } 
}