openlsd.common.datatype.LSDLock Class Reference

Collaboration diagram for openlsd.common.datatype.LSDLock:

Collaboration graph
[legend]

List of all members.


Detailed Description

Non reentrant Simple Lock (Lock is blocking, not unlock)
Author:
Frederic Bregier LGPL

Public Member Functions

 LSDLock ()
void lock ()
void unlock ()
boolean isLocked ()

Private Attributes

AtomicBoolean lock = new AtomicBoolean(false)
Random random = null

Constructor & Destructor Documentation

openlsd.common.datatype.LSDLock.LSDLock (  ) 

Create a LSDLock


Member Function Documentation

Take the lock if possible or wait until it is unlocked.

void openlsd.common.datatype.LSDLock.unlock (  ) 

Unlock immediately. (multiple calls reset to unlock too)

boolean openlsd.common.datatype.LSDLock.isLocked (  ) 

Get the status of the lock

Returns:
the status of the lock


Member Data Documentation

AtomicBoolean openlsd.common.datatype.LSDLock.lock = new AtomicBoolean(false) [private]

Internal Lock

Random openlsd.common.datatype.LSDLock.random = null [private]

Random waiting


The documentation for this class was generated from the following file: