pnuts.util
Class Mutex

java.lang.Object
  |
  +--pnuts.util.Mutex

public class Mutex
extends java.lang.Object

A simple mutex class


Constructor Summary
Mutex()
          create mutex object
Mutex(boolean priv)
          create mutex object
 
Method Summary
 void lock()
          Lock it Be careful not to deadlock.
 void unlock()
          Unlock it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mutex

public Mutex()
create mutex object

Mutex

public Mutex(boolean priv)
create mutex object
Parameters:
priv - If true a lock belongs to one owner otherwise not.
Method Detail

lock

public void lock()
          throws java.lang.InterruptedException
Lock it Be careful not to deadlock.

unlock

public void unlock()
Unlock it