Beispiel #1
0
  /**
   * @param key Key.
   * @param sync Sync that got from {@link #lockInterruptibly(Object)} call.
   */
  public <T> void unlock(T key, Object sync) {
    if (!locks.remove(key, sync))
      throw new IllegalStateException("Lock has not been acquired for key: " + key);

    ((Sync) sync).finish();
  }