private void aboutToAcquire ( CycleDetectingLock lock ) { if ( ! lock . isAcquiredByCurrentThread ( ) ) { ArrayList < LockGraphNode > acquiredLockList = acquiredLocks . get ( ) ; LockGraphNode node = lock . getLockGraphNode ( ) ; node . checkAcquiredLocks ( policy , acquiredLockList ) ; acquiredLockList . add ( node ) ; } }
CycleDetectingLock implementations must call this method before attempting to acquire the lock .