JHPcte
Class Mutex

java.lang.Object
  |
  +--JHPcte.Mutex

public class Mutex
extends java.lang.Object

A simple mutex class.


Constructor Summary
Mutex()
           
 
Method Summary
 boolean isLocked()
          Check if mutex is locked.
 void lock()
          Lock the mutex.
 void unlock()
          Unlock the mutex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mutex

public Mutex()
Method Detail

lock

public void lock()
Lock the mutex. Only one thread kann lock at one time.

unlock

public void unlock()
Unlock the mutex. Only one thread kan unlock at one time.

isLocked

public boolean isLocked()
Check if mutex is locked.