arlut.csd.Util
Class booleanSemaphore

java.lang.Object
  |
  +--arlut.csd.Util.booleanSemaphore

public class booleanSemaphore
extends java.lang.Object

Simple, synchronized boolean flag class.

This class is useful for providing a reliable boolean flag that can be examined by separate threads without worry over funky memory model behavior on multiprocessor systems, etc.


Field Summary
private  boolean state
           
 
Constructor Summary
booleanSemaphore(boolean initialState)
           
 
Method Summary
 boolean isSet()
           
 boolean set(boolean b)
          Simple bidirectional test and set.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

state

private boolean state
Constructor Detail

booleanSemaphore

public booleanSemaphore(boolean initialState)
Method Detail

isSet

public boolean isSet()

set

public boolean set(boolean b)

Simple bidirectional test and set.

Returns:
The value that the booleanSemaphore had before set() was called.