Women in Technology

Hear us Roar



Article:
  Advanced Synchronization in Java Threads, Part 2
Subject:   No matching call to freeIfHardwait if DeadlockDetectedException thrown
Date:   2007-06-15 11:34:15
From:   readuntil
Hi. The function DeadlockDetectingLock.lock works as follws: if lock is not already held by current thread, call markAsHardwait which adds the current thread to the list of hardwaiting threads, then checks the deadlock condition by calling canThreadWaitOnLock. If a deadlock condition is found, an exception is thrown, but there is no matching call to freeIfHardwait. The call to freeIfHardwait only happens if the deadlock condition is false and super.lock succeeds. Thanks.