public synchronized boolean leave ( long maxWait , TimeUnit unit ) throws Exception { long startMs = System . currentTimeMillis ( ) ; boolean hasMaxWait = ( unit != null ) ; long maxWaitMs = hasMaxWait ? TimeUnit . MILLISECONDS . convert ( maxWait , unit ) : Long . MAX_VALUE ; return internalLeave ( startMs , hasMaxWait , maxWaitMs ) ; }
Leave the barrier and block until all members have left or the timeout has elapsed