Interface DeadlockChecker
public interface DeadlockChecker
An interface to implement the deadlock algorithm.
- Since:
- 8.0
- Author:
- Pedro Ruivo
-
Method Summary
Modifier and TypeMethodDescriptionbooleandeadlockDetected(Object pendingOwner, Object currentOwner) It checks for deadlock.
-
Method Details
-
deadlockDetected
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.
-