/** * We have finished waiting on the given semaphore. Update the operation queue according * to whether we succeeded in obtaining the lock. * * @param semaphore The semaphore that we waited on * @param acquired <code>true</code> if we successfully acquired the semaphore, and <code>false</code> otherwise * @return whether the lock was successfully obtained */ private synchronized boolean updateOperationQueue(Semaphore semaphore, boolean acquired) { // Bug 311863 - Semaphore may have been released concurrently, so check again before discarding it if (!acquired) acquired = semaphore.attempt(); if (acquired) { depth++; updateCurrentOperation(); } else { removeFromQueue(semaphore); manager.removeLockWaitThread(Thread.currentThread(), this); } return acquired; }
/** * We have finished waiting on the given semaphore. Update the operation queue according * to whether we succeeded in obtaining the lock. * * @param semaphore The semaphore that we waited on * @param acquired <code>true</code> if we successfully acquired the semaphore, and <code>false</code> otherwise * @return whether the lock was successfully obtained */ private synchronized boolean updateOperationQueue(Semaphore semaphore, boolean acquired) { // Bug 311863 - Semaphore may have been released concurrently, so check again before discarding it if (!acquired) acquired = semaphore.attempt(); if (acquired) { depth++; updateCurrentOperation(); } else { removeFromQueue(semaphore); manager.removeLockWaitThread(Thread.currentThread(), this); } return acquired; }
/** * We have finished waiting on the given semaphore. Update the operation queue according * to whether we succeeded in obtaining the lock. * * @param semaphore The semaphore that we waited on * @param acquired <code>true</code> if we successfully acquired the semaphore, and <code>false</code> otherwise * @return whether the lock was successfully obtained */ private synchronized boolean updateOperationQueue(Semaphore semaphore, boolean acquired) { // Bug 311863 - Semaphore may have been released concurrently, so check again before discarding it if (!acquired) acquired = semaphore.attempt(); if (acquired) { depth++; updateCurrentOperation(); } else { removeFromQueue(semaphore); manager.removeLockWaitThread(Thread.currentThread(), this); } return acquired; }
removeFromQueue(semaphore); depth++; manager.addLockThread(currentOperationThread, this); updateCurrentOperation(); } else { removeFromQueue(semaphore); manager.removeLockWaitThread(Thread.currentThread(), this);
removeFromQueue(semaphore); depth++; manager.addLockThread(currentOperationThread, this);
removeFromQueue(semaphore); depth++; manager.addLockThread(currentOperationThread, this);
removeFromQueue(semaphore); depth++; manager.addLockThread(currentOperationThread, this);