Interface DeadlockChecker


  • public interface DeadlockChecker
    An interface to implement the deadlock algorithm.
    Since:
    8.0
    Author:
    Pedro Ruivo
    • 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 the currentOwner is the current lock owner. If a deadlock is detected and the pendingOwner must rollback, it must return true. If no deadlock is found or the currentOwner must rollback, it must return false.

        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 the pendingOwner must rollback.