Class DeadlockDetector

java.lang.Object
org.jppf.utils.concurrent.DeadlockDetector

public class DeadlockDetector extends Object
This class performs periodic deadlock checks and prints detailed deadlock information, along with a thread dump, to the log, the first time a deadlock is detected.
Author:
Laurent Cohen
  • Constructor Details

    • DeadlockDetector

      public DeadlockDetector()
  • Method Details

    • setup

      public static void setup(String type)
      Start the periodic deadlock checks.
      Parameters:
      type - the type of JPPF component, either "driver" or "node".
    • setup

      public static void setup(String type, long interval)
      Start the periodic deadlock checks.
      Parameters:
      type - the type of JPPF component, either "driver" or "node".
      interval - interval between 2 checks in millis.
    • getMonitorOwner

      public static ThreadInfo getMonitorOwner(Object object)
      Get information on the thread that owns the monitor of the specified object.
      Parameters:
      object - the object for which to lookup an owning thread.
      Returns:
      a ThreadInfo object, or null if no thread own the object's monitor.
    • printThreadInfo

      public static String printThreadInfo(ThreadInfo info)
      Print details of the specified thread, including monitors and locks, into a string.
      Parameters:
      info - the thread info to print.
      Returns:
      a formatted plain text string with the thread details.