Task.WaitAll method (1 of 5)

Waits for all of the provided Task objects to complete execution.

public static void WaitAll(params Task[] tasks)
parameter description
tasks The tasks to wait for completion.

See Also


Task.WaitAll method (2 of 5)

Waits for all of the provided Task objects to complete execution unless the wait is cancelled.

public static void WaitAll(Task[] tasks, CancellationToken cancellationToken)
parameter description
tasks The tasks to wait for completion.
cancellationToken Cancellation token that can be used to cancel the wait.

See Also


Task.WaitAll method (3 of 5)

Waits for all of the provided Task objects to complete execution within a specified number of milliseconds.

public static bool WaitAll(Task[] tasks, int millisecondsTimeout)
parameter description
tasks The tasks to wait for completion.
millisecondsTimeout The number of milliseconds to wait, or -1 to wait indefinitely.

Return Value

True if all tasks completed execution within the allotted time; otherwise, false.

See Also


Task.WaitAll method (4 of 5)

Waits for all of the provided Task objects to complete execution within a specified time interval.

public static bool WaitAll(Task[] tasks, TimeSpan timeout)
parameter description
tasks The tasks to wait for completion.
timeout A time span that represents the number of milliseconds to wait, or TimeSpan.FromMilliseconds(-1) to wait indefinitely.

Return Value

True if all tasks completed execution within the allotted time; otherwise, false.

See Also


Task.WaitAll method (5 of 5)

Waits for any of the provided Task objects to complete execution within a specified number of milliseconds or until a cancellation token is cancelled.

public static bool WaitAll(Task[] tasks, int millisecondsTimeout, 
    CancellationToken cancellationToken)
parameter description
tasks The tasks to wait for completion.
millisecondsTimeout The number of milliseconds to wait, or -1 to wait indefinitely.
cancellationToken Cancellation token that can be used to cancel the wait.

Return Value

True if all tasks completed execution within the allotted time; otherwise, false.

See Also