Interface DeadlockChecker
-
public interface DeadlockCheckerAn interface to implement the deadlock algorithm.- Since:
- 8.0
- Author:
- Pedro Ruivo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandeadlockDetected(Object pendingOwner, Object currentOwner)It checks for deadlock.
-
-
-
Method Detail
-
deadlockDetected
boolean deadlockDetected(Object pendingOwner, Object currentOwner)
It checks for deadlock.It accepts two arguments: the
pendingOwneris a lock owner that tries to acquire the lock and thecurrentOwneris the current lock owner. If a deadlock is detected and thependingOwnermust rollback, it must returntrue. If no deadlock is found or thecurrentOwnermust rollback, it must returnfalse.This method may be invoked multiples times and in multiple threads. Thread safe is advised.
- Parameters:
pendingOwner- a lock owner that tries to acquire the lock.currentOwner- the current lock owner.- Returns:
trueif a deadlock is detected and thependingOwnermust rollback.
-
-