public abstract class ParkEvent extends Object
ParkEvent.initializeOnce(com.oracle.svm.core.jdk.UninterruptibleUtils.AtomicReference<com.oracle.svm.core.thread.ParkEvent>, boolean)
and ParkEvent.detach(com.oracle.svm.core.jdk.UninterruptibleUtils.AtomicReference<com.oracle.svm.core.thread.ParkEvent>)
with three states and atomic
transitions
:
UninterruptibleUtils.AtomicReference
is null.
ParkEvent
that allows wait and unpark
operations.
DetachedParkEvent
singleton.
Modifier and Type | Class and Description |
---|---|
static interface |
ParkEvent.ParkEventFactory |
static class |
ParkEvent.WaitResult |
Modifier and Type | Field and Description |
---|---|
protected boolean |
event
The ticket: false implies unavailable, true implies available.
|
protected boolean |
resetEventBeforeWait
When true, calls to
ParkEvent.condWait() and ParkEvent.condTimedWait(long) will always wait, even a
previous call to ParkEvent.unpark() had not been consumed by a wait yet (the semantics of
Thread.sleep(long) ). |
Modifier | Constructor and Description |
---|---|
protected |
ParkEvent()
Constructor for subclasses.
|
Modifier and Type | Method and Description |
---|---|
protected abstract ParkEvent.WaitResult |
condTimedWait(long delayNanos)
cond_timedwait, similar to
ParkEvent.condWait() but with a timeout in nanoseconds. |
protected abstract ParkEvent.WaitResult |
condWait() |
protected abstract void |
unpark()
Notify anyone waiting on this event.
|
protected boolean event
protected boolean resetEventBeforeWait
ParkEvent.condWait()
and ParkEvent.condTimedWait(long)
will always wait, even a
previous call to ParkEvent.unpark()
had not been consumed by a wait yet (the semantics of
Thread.sleep(long)
).
When false, ParkEvent.condWait()
and ParkEvent.condTimedWait(long)
will return immediately when a
previous call to ParkEvent.unpark()
has happend (the semantics of Unsafe.park(boolean, long)
).protected abstract ParkEvent.WaitResult condWait()
protected abstract ParkEvent.WaitResult condTimedWait(long delayNanos)
ParkEvent.condWait()
but with a timeout in nanoseconds.protected abstract void unpark()