Class AbbaLockingDetector
java.lang.Object
org.h2.util.AbbaLockingDetector
- All Implemented Interfaces:
Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap of (object A) -> ( map of (object locked before object A) -> (stack trace where locked) )private booleanprivate Threadprivate final ThreadMXBeanprivate final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voiddumpStackTraceElement(ThreadInfo info, StringBuilder sb, int i, StackTraceElement e) private static voidgenerateOrdering(List<String> lockOrder, ThreadInfo info) We cannot simply call getLockedMonitors because it is not guaranteed to return the locks in the correct order.private static StringgetObjectName(MonitorInfo info) private static StringDump data in the same format asThreadInfo.toString(), but with some modifications (no stack frame limit, and removal of uninteresting stack frames)private voidmarkHigher(List<String> lockOrder, ThreadInfo threadInfo) private voidprocessThreadList(ThreadInfo[] threadInfoList) voidreset()Reset the state.voidrun()Start collecting locking data.Stop collecting.private voidtick()
-
Field Details
-
tickIntervalMs
private final int tickIntervalMs- See Also:
-
stop
private volatile boolean stop -
threadMXBean
-
thread
-
lockOrdering
-
knownDeadlocks
-
-
Constructor Details
-
AbbaLockingDetector
public AbbaLockingDetector()
-
-
Method Details
-
startCollecting
-
reset
public void reset()Reset the state. -
stopCollecting
-
run
-
tick
private void tick() -
processThreadList
-
generateOrdering
We cannot simply call getLockedMonitors because it is not guaranteed to return the locks in the correct order. -
markHigher
-
getStackTraceForThread
Dump data in the same format asThreadInfo.toString(), but with some modifications (no stack frame limit, and removal of uninteresting stack frames) -
dumpStackTraceElement
private static void dumpStackTraceElement(ThreadInfo info, StringBuilder sb, int i, StackTraceElement e) -
getObjectName
-