ccs.beetree
Class LockHolderGroup

java.lang.Object
  extended by ccs.beetree.LockHolderGroup

public class LockHolderGroup
extends java.lang.Object

Represents a group of threads which all hold a lock, or some other object which has the same semantics. Mostly BeeTree internals, but public in case it is of some use elsewhere. MT-Safe. Note that all the methods allow operations only on the current thread; this is to avoid potential race conditions.


Constructor Summary
LockHolderGroup()
           
 
Method Summary
 boolean containsCurrentThread()
          Whether the current thread is a member of the group.
 void popCurrentThread()
          Decrement the hold count of the current thread; if the hold count becomes zero, remove the current thread from the group.
 void putCurrentThread()
          Add the current thread to the group, or increment its hold count if already present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockHolderGroup

public LockHolderGroup()
Method Detail

putCurrentThread

public void putCurrentThread()
Add the current thread to the group, or increment its hold count if already present. Call this after gaining the corresponding lock.


popCurrentThread

public void popCurrentThread()
Decrement the hold count of the current thread; if the hold count becomes zero, remove the current thread from the group. Call this before dropping the corresponding lock.


containsCurrentThread

public boolean containsCurrentThread()
Whether the current thread is a member of the group.