openlsd.common.datatype
Class LSDLock

java.lang.Object
  extended by openlsd.common.datatype.LSDLock

public class LSDLock
extends java.lang.Object

Non reentrant Simple Lock (Lock is blocking, not unlock)

Author:
Frederic Bregier LGPL

Constructor Summary
LSDLock()
          Create a LSDLock
 
Method Summary
 boolean isLocked()
          Get the status of the lock
 void lock()
          Take the lock if possible or wait until it is unlocked.
 void unlock()
          Unlock immediately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSDLock

public LSDLock()
Create a LSDLock

Method Detail

lock

public void lock()
Take the lock if possible or wait until it is unlocked.


unlock

public void unlock()
Unlock immediately. (multiple calls reset to unlock too)


isLocked

public boolean isLocked()
Get the status of the lock

Returns:
the status of the lock