Waits for all the elements in the specified array to receive a signal, using a TimeSpan value to specify the time interval.
- waitHandles
- A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object.
- timeout
- A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds, to wait indefinitely.
true when every element in waitHandles has received a signal; otherwise, false.
If timeout is zero, the method does not block. It tests the state of the wait handles and returns immediately.
The erload:System.Threading.WaitHandle.WaitAll method returns when the wait terminates, which means either all the handles are signaled or a time-out occurs. On some implementations, if more than 64 handles are passed, a NotSupportedException is thrown. If the array contains duplicates, the call will fail.
The erload:System.Threading.WaitHandle.WaitAll method is not supported on threads that have STAThreadAttribute.
The maximum value for timeout is int.MaxValue.
Calling this method overload is the same as calling the WaitHandle.WaitAll(WaitHandle[], TimeSpan, bool) overload and specifying false for exitContext.