EDU.oswego.cs.dl.util.concurrent
Class WaitableRef
- Executor
WaitableRef(Object initialValue) - Create a WaitableRef initially holding the given reference
and using its own internal lock.
|
WaitableRef(Object initialValue, Object lock) - Make a new WaitableRef with the given initial value,
and using the supplied lock.
|
boolean | commit(Object assumedValue, Object newValue) - Set value to newValue only if it is currently assumedValue.
|
Object | set(Object newValue) - Set to newValue.
|
void | whenEqual(Object c, Runnable action) - Wait until value equals c, then run action if nonnull.
|
void | whenNotEqual(Object c, Runnable action) - wait until value not equal to c, then run action if nonnull.
|
void | whenNotNull(Runnable action) - wait until value is nonnull, then run action if nonnull.
|
void | whenNull(Runnable action) - Wait until value is null, then run action if nonnull.
|
WaitableRef
public WaitableRef(Object initialValue)
Create a WaitableRef initially holding the given reference
and using its own internal lock.
WaitableRef
public WaitableRef(Object initialValue,
Object lock)
Make a new WaitableRef with the given initial value,
and using the supplied lock.
commit
public boolean commit(Object assumedValue,
Object newValue)
Set value to newValue only if it is currently assumedValue.
- commit in interface SynchronizedRef
whenEqual
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.
whenNotEqual
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.
whenNotNull
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.
whenNull
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.