Beispiel #1
0
  @Override
  public boolean schedule(int timeout) {
    if (timeout < 1) throw new IllegalArgumentException();

    final ReentrantLock lock = m_lock;
    if (!lock.tryLock()) // fail-fast
    return false;

    try {
      return m_state.schedule(this, timeout);
    } finally {
      lock.unlock();
    }
  }