All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.util.concurrent.locks.DeadlockChecker Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.util.concurrent.locks;

/**
 * An interface to implement the deadlock algorithm.
 *
 * @author Pedro Ruivo
 * @since 8.0
 */
public interface DeadlockChecker {

   /**
    * It checks for deadlock.
    * 

* It accepts two arguments: the {@code pendingOwner} is a lock owner that tries to acquire the lock and the {@code * currentOwner} is the current lock owner. If a deadlock is detected and the {@code pendingOwner} must rollback, it * must return {@code true}. If no deadlock is found or the {@code currentOwner} must rollback, it must return {@code * false}. *

* This method may be invoked multiples times and in multiple threads. Thread safe is advised. * * @param pendingOwner a lock owner that tries to acquire the lock. * @param currentOwner the current lock owner. * @return {@code true} if a deadlock is detected and the {@code pendingOwner} must rollback. */ boolean deadlockDetected(Object pendingOwner, Object currentOwner); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy