WaitHandleExtensionsWaitAll(IEnumerableManualResetEventSlim, CancellationToken) Method

Waits for all the specified ManualResetEventSlim elements to receive a signal.

Definition

Namespace: Gemstone.Threading.WaitHandleExtensions
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.166 -- Release Build+55b93eb16d4a5b73f01a183dc992e29d98627d25
public static bool WaitAll(
	this IEnumerable<ManualResetEventSlim> resetEvents,
	CancellationToken? cancellationToken = null
)

Parameters

resetEvents  IEnumerableManualResetEventSlim
Collection of ManualResetEventSlim elements to operate on.
cancellationToken  CancellationToken  (Optional)
A CancellationToken to observe, if any.

Return Value

Boolean
true when every ManualResetEventSlim element has received a signal; otherwise the method never returns unless cancelled.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableManualResetEventSlim. 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).

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.

Exceptions

ArgumentNullExceptionresetEvents is null.

See Also