Top Description Fields Constructors Methods
org.h2.util

public Class AbbaDetector

extends Object
Class Inheritance
Imports
java.util.ArrayDeque, .Deque, .HashSet, .Map, .Set, .WeakHashMap

Utility to detect AB-BA deadlocks.

Field Summary

Modifier and TypeField and Description
private static final Set<String>
private static final Map<Object, Map<Object, Exception>>
LOCK_ORDERING

Map of (object A) -> ( map of (object locked before object A) -> (stack trace where locked) )

private static final ThreadLocal<Deque<Object>>
private static final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object

Returns:

the object that was passed
begin
(Object
the object, or null for the current class
o
)

This method is called just before or just after an object is synchronized.

private static String
private static Object
private static synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

KNOWN_DEADLOCKSback to summary
private static final Set<String> KNOWN_DEADLOCKS
LOCK_ORDERINGback to summary
private static final Map<Object, Map<Object, Exception>> LOCK_ORDERING

Map of (object A) -> ( map of (object locked before object A) -> (stack trace where locked) )

STACKback to summary
private static final ThreadLocal<Deque<Object>> STACK
TRACEback to summary
private static final boolean TRACE

Constructor Detail

AbbaDetectorback to summary
public AbbaDetector()

Method Detail

beginback to summary
public static Object begin(Object o)

This method is called just before or just after an object is synchronized.

Parameters
o:Object

the object, or null for the current class

Returns:Object

the object that was passed

getObjectNameback to summary
private static String getObjectName(Object o)
getTestback to summary
private static Object getTest(Object o)
markHigherback to summary
private static synchronized void markHigher(Object o, Deque<Object> older)