Home » concurrent-sources » EDU.oswego.cs.dl.util.concurrent » [javadoc | source]
EDU.oswego.cs.dl.util.concurrent
public class: WaitableRef [javadoc | source]
java.lang.Object
   EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable
      EDU.oswego.cs.dl.util.concurrent.SynchronizedRef
         EDU.oswego.cs.dl.util.concurrent.WaitableRef

All Implemented Interfaces:
    Executor

A class useful for offloading synch for Object reference instance variables.

[ Introduction to this package. ]
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedRef:
value_
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable:
lock_
Constructor:
 public WaitableRef(Object initialValue) 
    Create a WaitableRef initially holding the given reference and using its own internal lock. *
 public WaitableRef(Object initialValue,
    Object lock) 
    Make a new WaitableRef with the given initial value, and using the supplied lock. *
Method from EDU.oswego.cs.dl.util.concurrent.WaitableRef Summary:
commit,   set,   whenEqual,   whenNotEqual,   whenNotNull,   whenNull
Methods from EDU.oswego.cs.dl.util.concurrent.SynchronizedRef:
commit,   get,   set,   swap
Methods from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable:
execute,   getLock
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from EDU.oswego.cs.dl.util.concurrent.WaitableRef Detail:
 public boolean commit(Object assumedValue,
    Object newValue) 
 public Object set(Object newValue) 
 public  void whenEqual(Object c,
    Runnable action) throws InterruptedException 
    Wait until value equals c, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenNotEqual(Object c,
    Runnable action) throws InterruptedException 
    wait until value not equal to c, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenNotNull(Runnable action) throws InterruptedException 
    wait until value is nonnull, then run action if nonnull. The action is run with the synchronization lock held. *
 public  void whenNull(Runnable action) throws InterruptedException 
    Wait until value is null, then run action if nonnull. The action is run with the synchronization lock held. *