public class CmsWaitHandle extends java.lang.Object
This is really a thin wrapper around the wait() and notifyAll() methods.
Constructor and Description |
---|
CmsWaitHandle()
Creates a reusable wait handle.
|
CmsWaitHandle(boolean singleUse)
Creates a wait handle.
|
Modifier and Type | Method and Description |
---|---|
void |
enter(long waitTime)
Waits for a maximum of waitTime, but returns if another thread calls release().
|
void |
release()
Releases all currently waiting threads.
|
public CmsWaitHandle()
public CmsWaitHandle(boolean singleUse)
The argument controls whether the wait handle will be single-use or reusable. The difference is that, for a single-use wait handle, all calls to enter() will return immediately after the first call to release(), while calling enter() on a reusable wait handle will always wait for the next release call.
singleUse
- true if a single-use wait handle should be created