Interface DeadlockChecker
-
public interface DeadlockChecker
An 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 boolean
deadlockDetected(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
pendingOwner
is a lock owner that tries to acquire the lock and thecurrentOwner
is the current lock owner. If a deadlock is detected and thependingOwner
must rollback, it must returntrue
. If no deadlock is found or thecurrentOwner
must 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:
true
if a deadlock is detected and thependingOwner
must rollback.
-
-