Package com.iizix.os

Class ThreadDeadlockDetector

java.lang.Object
com.iizix.os.ThreadDeadlockDetector

public class ThreadDeadlockDetector extends Object
A Thread dead-lock detector.
Author:
Christopher Mindus
  • Constructor Details

    • ThreadDeadlockDetector

      public ThreadDeadlockDetector()
  • Method Details

    • getThreadMXBean

      public static ThreadMXBean getThreadMXBean()
      Gets the ThreadMXBean instance.
    • startDeadlockCheck

      public static boolean startDeadlockCheck()
      Starts the singleton timer to perform dead-lock checking every 60 seconds, once only.
      Returns:
      true for OK, false if already started.
    • startDeadlockCheck

      public static boolean startDeadlockCheck(long interval)
      Starts the singleton timer to perform dead-lock checking, once only.
      Parameters:
      interval - In milliseconds.
      Returns:
      true for OK, false if already started.
    • stopDeadlockCheck

      public static boolean stopDeadlockCheck()
      Stops the singleton timer to perform dead-lock checking, once only.
      Returns:
      true for OK, false if already stopped or never started.
    • checkForDeadlocks

      public static void checkForDeadlocks()
      Checks for deadlocks. If a dead-lock is found, it is logged in the server.