Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change prevents an endless loop in: ReentrantCycleDetectingLock.…
…detectPotentialLocksCycle() Due to how code in ReentrantCycleDetectingLock.lockOrDetectPotentialLocksCycle() is synchronized, its possible for a thread to both own/hold a lock (according to ReentrantCycleDetectingLock.lockOwnerThread) and wait on the same lock (according to CycleDetectingLock.lockThreadIsWaitingOn). In this state, if another thread tries to hold the same lock an endless loop will occur when calling detectPotentialLocksCycle(). With this change detectPotentialLocksCycle() removes the lock owning thread from ReentrantCycleDetectingLock.lockOwnerThread, if it detects that "this" lock is both waited on and owned by the same thread. This prevents the endless loop during cycle detection. Fix for: #1510
- Loading branch information