AsyncManualResetEvent(Boolean, Boolean) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the AsyncManualResetEvent class.
AsyncManualResetEvent(bool initialState = false, bool allowInliningAwaiters = false);
public AsyncManualResetEvent (bool initialState = false, bool allowInliningAwaiters = false);
new Microsoft.VisualStudio.Threading.AsyncManualResetEvent : bool * bool -> Microsoft.VisualStudio.Threading.AsyncManualResetEvent
Public Sub New (Optional initialState As Boolean = false, Optional allowInliningAwaiters As Boolean = false)
Parameters
- initialState
- Boolean
A value indicating whether the event should be initially signaled.
- allowInliningAwaiters
- Boolean
A value indicating whether to allow WaitAsync() callers' continuations to execute
on the thread that calls Microsoft.VisualStudio.Threading.AsyncManualResetEvent.SetAsync before the call returns.
Microsoft.VisualStudio.Threading.AsyncManualResetEvent.SetAsync callers should not hold private locks if this value is true
to avoid deadlocks.
When false
, the task returned from WaitAsync() may not have fully transitioned to
its completed state by the time Microsoft.VisualStudio.Threading.AsyncManualResetEvent.SetAsync returns to its caller.
Remarks
false
better simulates the behavior of theManualResetEventSlim class, but true
can result in slightly better performance.