com.sleepycat.je.utilint
Class TimingLatch
java.lang.Object
com.sleepycat.je.latch.Latch
com.sleepycat.je.utilint.TimingLatch
public class TimingLatch
- extends Latch
A subclass of Latch that may be used for debugging performance issues. This
latch can be used in place of an exclusive latch or object mutex in order to
see who is waiting for a latch acquisition, how long they're waiting, and
who the previous holder was. It crudely writes to System.out, but this can
easily be changed to a java.util.Log or EventTrace as desired. You can
specify a threshold for the wait and previous holder time (nanos).
Method Summary |
void |
acquire()
Acquire a latch for exclusive/write access. |
void |
release()
Release the latch. |
TimingLatch
public TimingLatch(String name,
boolean debug)
TimingLatch
public TimingLatch(String name,
boolean debug,
int waitThreshold,
int holdThreshold)
release
public void release()
- Description copied from class:
Latch
- Release the latch. If there are other thread(s) waiting for the latch,
they are woken up and granted the latch.
- Overrides:
release
in class Latch
acquire
public void acquire()
- Description copied from class:
Latch
- Acquire a latch for exclusive/write access.
Wait for the latch if some other thread is holding it. If there are
threads waiting for access, they will be granted the latch on a FIFO
basis. When the method returns, the latch is held for exclusive
access.
- Overrides:
acquire
in class Latch
Copyright (c) 2004-2010 Oracle. All rights reserved.