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. |
waitAllpublic 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()
WaitHandleWaitHandle receives a signal.waitOne in class WaitHandlepublic boolean waitOne(int millisecondsTimeout)
WaitHandleWaitHandle receives a signal,
using a 32-bit signed integer to specify the time interval.waitOne in class WaitHandlemillisecondsTimeout - The number of milliseconds to wait, or -1 to wait indefinitely.public void close()
WaitHandleclose in interface IDisposableclose in interface AutoCloseableclose in class WaitHandlepublic void dispose()
IDisposabledispose in interface IDisposable