galaxy.util
Class FifoMutex

java.lang.Object
  |
  +--galaxy.util.FifoMutex

public class FifoMutex
extends java.lang.Object

A first in, first out (FIFO) mutex. This is a reentrant mutex, meaning the same thread can acquire the lock multiple times. However, you must make sure to release the lock the same number of times or else other threads will be unable to acquire the lock.


Constructor Summary
FifoMutex()
           
 
Method Summary
 void lock()
          Locks the mutex.
 void unlock()
          Unlocks the mutex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FifoMutex

public FifoMutex()
Method Detail

lock

public void lock()
Locks the mutex. This is a blocking operation.

unlock

public void unlock()
Unlocks the mutex. This method must be called once for each time the thread requested the lock (via the lock method). A thread will not release the lock until this is done.