예제 #1
0
 private void markAsWaitingFor(
     ForsetiLockManager.Lock lock, Locks.ResourceType type, long resourceId) {
   clearWaitList();
   lock.copyHolderWaitListsInto(waitList);
   if (lock.anyHolderIsWaitingFor(myId) && lock.holderWaitListSize() >= waitListSize()) {
     waitList.clear();
     throw new DeadlockDetectedException(
         this
             + " can't acquire "
             + lock
             + " on "
             + type
             + "("
             + resourceId
             + "), because holders of that lock "
             + "are waiting for "
             + this
             + ".\n Wait list:"
             + lock.describeWaitList());
   }
 }
예제 #2
0
 private void clearWaitList() {
   waitList.clear();
   waitList.put(myId);
 }