Click or drag to resize

WaitHandleExtensions.WaitAll(IEnumerable<ManualResetEventSlim> , TimeSpan, CancellationToken) Method

Waits for all the specified ManualResetEventSlim elements to receive a signal, using a TimeSpan value to specify the maximum time interval to wait.

Namespace: GSF.Threading
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.239-beta+5928cebde0dd955df84e791f5ea67acbd192773e
Syntax
public static bool WaitAll(
	this IEnumerable<ManualResetEventSlim> resetEvents,
	TimeSpan timeout,
	CancellationToken cancellationToken = null
)
View Source

Parameters

resetEvents  IEnumerable<ManualResetEventSlim>
Collection of ManualResetEventSlim elements to operate on.
timeout  TimeSpan
A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds, to wait indefinitely.
cancellationToken  CancellationToken  (Optional)
A CancellationToken to observe, if any.

Return Value

Boolean
true when every ManualResetEventSlim element has received a signal; otherwise false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<ManualResetEventSlim>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionresetEvents is null.
Remarks
Using WaitAll(WaitHandle[]) will cause all ManualResetEventSlim elements to be upgraded to a standard ManualResetEvent, these overloads allow similar functionality without incurring unconditional inflation of the underlying ManualResetEvent.
See Also