org.neodatis.tool.mutex
Class Mutex

java.lang.Object
  extended by 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)
           
 
Method Summary
 Mutex acquire(java.lang.String who)
           
 boolean attempt(long msecs)
           
 java.lang.String getName()
           
 int getNbOwners()
           
 boolean isInUse()
           
 void release(java.lang.String who)
           
 void setDebug(boolean debug)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inUse

protected boolean inUse
The lock status *


nbOwners

protected int nbOwners
Constructor Detail

Mutex

protected Mutex(java.lang.String name)
Method Detail

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()