org.sourceforge.jemm.util
Class LockStack

java.lang.Object
  extended by org.sourceforge.jemm.util.LockStack

public final class LockStack
extends java.lang.Object

A ThreadLock stack which tracks how deep within locks a Thread current is.

Author:
Paul Keeble

Method Summary
static void clearAll()
          Gets rid of all locks.
static boolean hasLock()
          If 1 or more locks are held returns true, else false.
static ClientThreadId pop()
          Removes a lock.
static void push(ClientThreadId id)
          Adds a lock.
static int size()
          Returns the number of locks currently held in the thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public static int size()
Returns the number of locks currently held in the thread.

Returns:
The size of the lock stack.

push

public static void push(ClientThreadId id)
Adds a lock.

Parameters:
id -

pop

public static ClientThreadId pop()
Removes a lock.

Returns:
The thread which was removed from the top of the lock stack.

clearAll

public static void clearAll()
Gets rid of all locks.


hasLock

public static boolean hasLock()
If 1 or more locks are held returns true, else false.

Returns:
True if any locks are held, false otherwise.


Copyright © 2009. All Rights Reserved.