public class EventWaitHandle extends WaitHandle implements IDisposable
Constructor and Description |
---|
EventWaitHandle(boolean initialState,
EventResetMode mode)
Initializes a new instance of the
EventWaitHandle class, specifying whether
the wait handle is initially signaled, and whether it resets automatically or
manually. |
Modifier and Type | Method and Description |
---|---|
void |
close()
When overridden in a derived class, releases all resources held by the current
WaitHandle.
|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting
unmanaged resources.
|
boolean |
reset()
Sets the state of the event to nonsignaled, causing threads to block.
|
boolean |
set()
Sets the state of the event to signaled, allowing one or more waiting threads to
proceed.
|
boolean |
waitOne()
Blocks the current thread until the current
WaitHandle receives a signal. |
boolean |
waitOne(int millisecondsTimeout)
Blocks the current thread until the current
WaitHandle receives a signal,
using a 32-bit signed integer to specify the time interval. |
waitAll
public EventWaitHandle(boolean initialState, @Nonnull EventResetMode mode)
EventWaitHandle
class, specifying whether
the wait handle is initially signaled, and whether it resets automatically or
manually.initialState
- true to set the initial state to signaled; false to set it to
nonsignaled.mode
- One of the EventResetMode
values that determines whether the
event resets automatically or manually.public boolean set()
public boolean reset()
public boolean waitOne()
WaitHandle
WaitHandle
receives a signal.waitOne
in class WaitHandle
public boolean waitOne(int millisecondsTimeout)
WaitHandle
WaitHandle
receives a signal,
using a 32-bit signed integer to specify the time interval.waitOne
in class WaitHandle
millisecondsTimeout
- The number of milliseconds to wait, or -1 to wait indefinitely.public void close()
WaitHandle
close
in interface IDisposable
close
in interface AutoCloseable
close
in class WaitHandle
public void dispose()
IDisposable
dispose
in interface IDisposable