Package org.jppf.utils.concurrent
Class DeadlockDetector
java.lang.Object
org.jppf.utils.concurrent.DeadlockDetector
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadInfogetMonitorOwner(Object object) Get information on the thread that owns the monitor of the specified object.static StringprintThreadInfo(ThreadInfo info) Print details of the specified thread, including monitors and locks, into a string.static voidStart the periodic deadlock checks.static voidStart the periodic deadlock checks.
-
Constructor Details
-
DeadlockDetector
public DeadlockDetector()
-
-
Method Details
-
setup
Start the periodic deadlock checks.- Parameters:
type- the type of JPPF component, either "driver" or "node".
-
setup
Start the periodic deadlock checks.- Parameters:
type- the type of JPPF component, either "driver" or "node".interval- interval between 2 checks in millis.
-
getMonitorOwner
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
ThreadInfoobject, ornullif no thread own the object's monitor.
-
printThreadInfo
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.
-