org.neodatis.tool.mutex
Class Mutex
java.lang.Object
org.neodatis.tool.mutex.Mutex
public class Mutex
- extends java.lang.Object
A Simple Mutex for lock operations
- Author:
- osmadja
Field Summary |
protected boolean |
inUse
The lock status * |
protected int |
nbOwners
|
Constructor Summary |
protected |
Mutex(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inUse
protected boolean inUse
- The lock status *
nbOwners
protected int nbOwners
Mutex
protected Mutex(java.lang.String name)
acquire
public Mutex acquire(java.lang.String who)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
release
public void release(java.lang.String who)
attempt
public boolean attempt(long msecs)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
getName
public java.lang.String getName()
setDebug
public void setDebug(boolean debug)
isInUse
public boolean isInUse()
getNbOwners
public int getNbOwners()