Package com.iizix.os
Class ThreadDeadlockDetector
- java.lang.Object
- com.iizix.os.ThreadDeadlockDetector
public class ThreadDeadlockDetector extends java.lang.Object
A Thread dead-lock detector.- Author:
- Christopher Mindus
Constructor Summary
Constructors Constructor Description ThreadDeadlockDetector()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkForDeadlocks()
Checks for deadlocks.static java.lang.management.ThreadMXBean
getThreadMXBean()
Gets the ThreadMXBean instance.static boolean
startDeadlockCheck(long interval)
Starts the singleton timer to perform dead-lock checking, once only.static boolean
stopDeadlockCheck()
Stops the singleton timer to perform dead-lock checking, once only.
Method Detail
getThreadMXBean
public static java.lang.management.ThreadMXBean getThreadMXBean()
Gets the ThreadMXBean instance.
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.