Exemplo n.º 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());
   }
 }
Exemplo n.º 2
0
 private void clearWaitList() {
   waitList.clear();
   waitList.put(myId);
 }