public void waitForBlock(Object key, Timespan timeout) throws TimeoutException, InterruptedException
  {
    _lock.lock();
    try
    {
      long endTime = System.currentTimeMillis() + timeout.getDurationInMilliseconds();

      while(!_waitingForBlock.contains(key))
      {
        ConcurrentUtils.awaitUntil(_blockCondition, endTime);
      }
    }
    finally
    {
      _lock.unlock();
    }
  }
public void waitForBlock(Object key, Timespan timeout) throws TimeoutException, InterruptedException
  {
    _lock.lock();
    try
    {
      long endTime = System.currentTimeMillis() + timeout.getDurationInMilliseconds();

      while(!_waitingForBlock.contains(key))
      {
        ConcurrentUtils.awaitUntil(_blockCondition, endTime);
      }
    }
    finally
    {
      _lock.unlock();
    }
  }
public void waitForBlock ( Object key , Timespan timeout ) throws TimeoutException , InterruptedException { _lock . lock ( ) ; try { long endTime = System . currentTimeMillis ( ) + timeout . getDurationInMilliseconds ( ) ; while ( ! _waitingForBlock . contains ( key ) ) { ConcurrentUtils . awaitUntil ( _blockCondition , endTime ) ; } } finally { _lock . unlock ( ) ; } }
Blocking call to wait for a thread to call <code>block</code>.

@param key the key we are waiting for
@throws TimeOutException
@throws InterruptedException
Blocking call to wait for a thread to call <code > block< / code > .