Gemstone Threading Library
Show/Hide TOC

# WaitHandleExtensionsWaitAll(IEnumerableManualResetEventSlim, 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.

## Definition

Namespace: Gemstone.Threading.WaitHandleExtensions
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.155 -- Release Build+fbb54a9347e09f19695376cbf86e09a9ff9ee9ca
C#
View Source Request Example

    public static bool WaitAll(
    	this IEnumerable<ManualResetEventSlim> resetEvents,
    	TimeSpan timeout,
    	CancellationToken cancellationToken
    )

VB
View Source Request Example

    <ExtensionAttribute>
    Public Shared Function WaitAll (
    	resetEvents As IEnumerable(Of ManualResetEventSlim),
    	timeout As TimeSpan,
    	cancellationToken As CancellationToken
    ) As Boolean

C++
View Source Request Example

    public:
    [ExtensionAttribute]
    static bool WaitAll(
    	IEnumerable<ManualResetEventSlim^>^ resetEvents,
    	TimeSpan timeout,
    	CancellationToken cancellationToken
    )

JavaScript
View Source Request Example

    Gemstone.Threading.WaitHandleExtensions.WaitHandleExtensions.WaitAll = function(resetEvents, timeout, cancellationToken);

#### Parameters

resetEvents IEnumerableManualResetEventSlim
  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
  A CancellationToken to observe.

#### 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 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

ArgumentNullException | resetEvents is null.

## See Also

#### Reference

WaitHandleExtensions Class
WaitAll Overload
Gemstone.Threading.WaitHandleExtensions Namespace