public final class SimpleLock
extends java.lang.Object
SimpleLock is a simple implementation of an
 exclusive lock.  It does not support nested lock/unlock pairs from
 the same thread.  It does not guarantee fairness.  It does not
 detect thread abandonment (i.e. thread exits while holding lock.)
 It does not verify that a thread actually holds the lock when it
 tries to unlock the lock. | Constructor and Description | 
|---|
SimpleLock()
Construct a new  
SimpleLock instance. | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
isLocked()
Fetches whether the lock is currently being held. 
 | 
void | 
lock()
Request the lock. 
 | 
void | 
unlock()
Releases the lock. 
 | 
public SimpleLock()
SimpleLock instance.  The lock
 is created in the unlocked state by default.public void lock()
public void unlock()
public boolean isLocked()