net.wimpi.telnetd.util
Class ReentrantLock

java.lang.Object
  extended by net.wimpi.telnetd.util.ReentrantLock

public class ReentrantLock
extends java.lang.Object

Version:
@version@ (@date@)
Author:
Doug Lea

Field Summary
protected  long m_Holds
           
protected  java.lang.Thread m_Owner
           
 
Constructor Summary
ReentrantLock()
           
 
Method Summary
 void acquire()
           
 boolean attempt(long msecs)
           
 long holds()
          Return the number of unreleased acquires performed by the current thread.
 void release()
          Release the lock.
 void release(long n)
          Release the lock N times.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Owner

protected java.lang.Thread m_Owner

m_Holds

protected long m_Holds
Constructor Detail

ReentrantLock

public ReentrantLock()
Method Detail

acquire

public void acquire()
             throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

attempt

public boolean attempt(long msecs)
                throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

release

public void release()
Release the lock.

Throws:
java.lang.Error - thrown if not current owner of lock

release

public void release(long n)
Release the lock N times. release(n) is equivalent in effect to:
   for (int i = 0; i < n; ++i) release();
 

Throws:
java.lang.Error - thrown if not current owner of lock or has fewer than N holds on the lock

holds

public long holds()
Return the number of unreleased acquires performed by the current thread. Returns zero if current thread does not hold lock.



Copyright © 2010. All Rights Reserved.