コード例 #1
0
ファイル: Lock.java プロジェクト: metasfresh/metasfresh
  @Override
  public void unlockAll() {
    assertHasRealOwner();

    try (CloseableReentrantLock l = mutex.open()) {
      // Mark it as closed.
      // If it was already closed, do nothing.
      if (closed.getAndSet(true)) {
        throw new LockAlreadyClosedException(this);
      }

      final LockOwner ownerCurrent = getOwner();

      final int countUnlocked =
          Services.get(ILockManager.class).unlock().setOwner(ownerCurrent).release();

      subtractCountLocked(countUnlocked);
    }
  }
コード例 #2
0
ファイル: Lock.java プロジェクト: metasfresh/metasfresh
 /* package */ final void subtractCountLocked(final int countLockedToSubtract) {
   try (CloseableReentrantLock l = mutex.open()) {
     _countLocked -= countLockedToSubtract;
   }
 }