JVMTI offers the events ContendedMonitorEnter
and ContendedMonitorEntered
to detect events related to the use of synchronized
. synchronized
is nothing else, but a ReentrantLock.
Now I would like to track also events related to the lock structure: ReentrantLock
. I could hook to method entry/exit of its lock()
and unlock()
events. However, these event hooks don't provide any information about the object they were invoked on. Thus I cannot distinguish between different ReentrantLock
and thus cannot log any information about which lock is currently locked.
Is there any other way to keep track of this?