Interface IWaitEvent
Provides a generalized API for ManualResetEvent and ManualResetEventSlim.
Namespace: Swan.Threading
Syntax
public interface IWaitEvent : IDisposable
Properties
IsCompleted
Gets a value indicating whether the event is in the completed state.
Declaration
bool IsCompleted { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsDisposed
Gets a value indicating whether this instance is disposed.
Declaration
bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsInProgress
Gets a value indicating whether the Begin method has been called. It returns false after the Complete method is called.
Declaration
bool IsInProgress { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsValid
Returns true if the underlying handle is not closed and it is still valid.
Declaration
bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Begin()
Enters the state in which waiters need to wait. All future waiters will block when they call the Wait method.
Declaration
void Begin()
Complete()
Leaves the state in which waiters need to wait. All current waiters will continue.
Declaration
void Complete()
Wait()
Waits for the event to be completed.
Declaration
void Wait()
Wait(TimeSpan)
Waits for the event to be completed.
Returns true
when there was no timeout. False if the timeout was reached.
Declaration
bool Wait(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeout | The maximum amount of time to wait for. |
Returns
Type | Description |
---|---|
Boolean |
|