Package com.iizix.os
Class ThreadDeadlockDetector
java.lang.Object
com.iizix.os.ThreadDeadlockDetector
A Thread dead-lock detector.
- Author:
- Christopher Mindus
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- static voidChecks for deadlocks.- static ThreadMXBeanGets the ThreadMXBean instance.- static booleanStarts the singleton timer to perform dead-lock checking every 60 seconds, once only.- static boolean- startDeadlockCheck- (long interval) Starts the singleton timer to perform dead-lock checking, once only.- static booleanStops the singleton timer to perform dead-lock checking, once only.
- Constructor Details- ThreadDeadlockDetectorpublic ThreadDeadlockDetector()
 
- Method Details- getThreadMXBeanGets the ThreadMXBean instance.
- startDeadlockCheckpublic static boolean startDeadlockCheck()Starts the singleton timer to perform dead-lock checking every 60 seconds, once only.- Parameters:
- interval- In milliseconds.
- Returns:
- true for OK, false if already started.
 
- startDeadlockCheckpublic 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.
 
- stopDeadlockCheckpublic 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.
 
- checkForDeadlockspublic static void checkForDeadlocks()Checks for deadlocks. If a dead-lock is found, it is logged in the server.