Waits for all the elements in the specified array to receive a signal, using an int 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 (duplicates).
- millisecondsTimeout
- The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely.
true when every element in waitHandles has received a signal; otherwise, false.
If millisecondsTimeout 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 when all the handles are signaled or when time-out occurs. On some implementations, if more than 64 handles are passed, a NotSupportedException is thrown. If there are duplicates in the array, the call fails with a DuplicateWaitObjectException.
The erload:System.Threading.WaitHandle.WaitAll method is not supported on threads that have STAThreadAttribute.
Calling this method overload is the same as calling the WaitHandle.WaitAll(WaitHandle[], int, bool) overload and specifying false for exitContext.