コード例 #1
0
ファイル: BooleanMutex.java プロジェクト: letorn/mytest
 /**
  * 阻塞等待Boolean为true,允许设置超时时间
  *
  * @param timeout
  * @param unit
  * @throws InterruptedException
  * @throws TimeoutException
  */
 public void lockTimeOut(long timeout, TimeUnit unit)
     throws InterruptedException, TimeoutException {
   sync.innerLock(unit.toNanos(timeout));
 }
コード例 #2
0
ファイル: BooleanMutex.java プロジェクト: letorn/mytest
 /**
  * 阻塞等待Boolean为true
  *
  * @throws InterruptedException
  */
 public void lock() throws InterruptedException {
   sync.innerLock();
 }