Class ManualResetEvent
java.lang.Object
co.yellowdog.platform.clients.objectstore.ManualResetEvent
Represents a thread synchronization event that, when signaled, must be reset manually.
-
Constructor Summary
ConstructorsConstructorDescriptionInitialises a new instance of ManualResetEvent with the initial state of closed.ManualResetEvent
(boolean open) Initialises a new instance of ManualResetEvent with the specified initial state. -
Method Summary
Modifier and TypeMethodDescriptionvoid
reset()
void
set()
Signals the event, unblocking all waiting threads.void
waitOne()
Blocks the calling thread until the event is signalled.boolean
waitOne
(long milliseconds) Blocks the calling thead until either the event is signalled or the specified timeout is reached.
-
Constructor Details
-
ManualResetEvent
public ManualResetEvent()Initialises a new instance of ManualResetEvent with the initial state of closed. -
ManualResetEvent
public ManualResetEvent(boolean open) Initialises a new instance of ManualResetEvent with the specified initial state.- Parameters:
open
- true, to allow threads to continue; false, to block threads until signalled.
-
-
Method Details
-
waitOne
Blocks the calling thread until the event is signalled.- Throws:
InterruptedException
- if the thread is interrupted
-
waitOne
Blocks the calling thead until either the event is signalled or the specified timeout is reached.- Parameters:
milliseconds
- the length of time to wait, in milliseconds- Returns:
- true, if the event has been signalled; false, if the timeout is reached without the thread having been signalled
- Throws:
InterruptedException
- if the thread is interrupted
-
set
public void set()Signals the event, unblocking all waiting threads. -
reset
-