Examples of PotentialDeadlockException


Examples of com.google.common.util.concurrent.CycleDetectingLockFactory.PotentialDeadlockException

    lockB.lock();
    lockA.unlock();
    lockB.unlock();

    // The opposite order should fail (Policies.THROW).
    PotentialDeadlockException firstException = null;
    lockB.lock();
    try {
      lockA.lock();
      fail("Expected PotentialDeadlockException");
    } catch (PotentialDeadlockException expected) {
      checkMessage(expected, "LockB -> LockA", "LockA -> LockB");
      firstException = expected;
    }

    // Second time should also fail, with a cached causal chain.
    try {
      lockA.lock();
      fail("Expected PotentialDeadlockException");
    } catch (PotentialDeadlockException expected) {
      checkMessage(expected, "LockB -> LockA", "LockA -> LockB");
      // The causal chain should be cached.
      assertSame(firstException.getCause(), expected.getCause());
    }

    // lockA should work after lockB is released.
    lockB.unlock();
    lockA.lock();
View Full Code Here

Examples of org.zkoss.lang.PotentialDeadLockException

          break; //then, load it
        }
      } //sync(_richlets)

      if (!lock.waitUntilUnlock(300*1000)) { //5 minute
        final PotentialDeadLockException ex =
          new PotentialDeadLockException(
          "Unable to load richlet "+name+"\nCause: conflict too long.");
        log.warningBriefly(ex); //very rare, possibly a bug
        throw ex;
      }
    } //for (;;)
View Full Code Here

Examples of org.zkoss.lang.PotentialDeadLockException

        //invalid, so remove it (if not updated by others)
        synchronized (this) {
          if (super.get(src) == ri) super.remove(src);
        }
      } else if (!lock.waitUntilUnlock(300*1000)) { //5 minute
        final PotentialDeadLockException ex =
          new PotentialDeadLockException(
          "Unable to load from "+src+"\nCause: conflict too long.");
        log.warningBriefly(ex); //very rare, possibly a bug
        throw ex;
      }
    } //for (;;)
View Full Code Here

Examples of org.zkoss.lang.PotentialDeadLockException

   * this lock. In other words, it tried to wait for itself to complete.
   */
  synchronized public boolean waitUntilUnlock(int timeout) {
    if (!_unlocked) {
      if (Thread.currentThread().equals(_locker))
        throw new PotentialDeadLockException("Wait for itself?");
      try {
        this.wait(timeout);
      } catch (InterruptedException ex) {
        throw SystemException.Aide.wrap(ex);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.