/** Interrupt every thread on this node waiting on this lock. */ private synchronized void interruptAll() { // First release all threads waiting on associated condition queues. if (!conditionMap.isEmpty()) { // Temporarily obtain ownership of the lock, // in order to signal all conditions. UUID tempUUID = getOwnerNode(); long tempThreadID = currentOwnerThreadId; setCurrentOwnerNode(thisNode); currentOwnerThreadId = Thread.currentThread().getId(); for (Condition c : conditionMap.values()) c.signalAll(); // Restore owner node and owner thread. setCurrentOwnerNode(tempUUID); currentOwnerThreadId = tempThreadID; } // Interrupt any future call to acquire/release on this sync object. interruptAll = true; // Interrupt any ongoing transactions. for (Thread t: getQueuedThreads()) t.interrupt(); }
/** Interrupt every thread on this node waiting on this lock. */ private synchronized void interruptAll() { // First release all threads waiting on associated condition queues. if (!conditionMap.isEmpty()) { // Temporarily obtain ownership of the lock, // in order to signal all conditions. UUID tempUUID = getOwnerNode(); long tempThreadID = currentOwnerThreadId; setCurrentOwnerNode(thisNode); currentOwnerThreadId = Thread.currentThread().getId(); for (Condition c : conditionMap.values()) c.signalAll(); // Restore owner node and owner thread. setCurrentOwnerNode(tempUUID); currentOwnerThreadId = tempThreadID; } // Interrupt any future call to acquire/release on this sync object. interruptAll = true; // Interrupt any ongoing transactions. for (Thread t: getQueuedThreads()) t.interrupt(); }