WaitAny()

System::Threading::Tasks::WaitAny(const ArrayPtr<TaskPtr>&, const CancellationToken&) function

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

int32_t System::Threading::Tasks::WaitAny(const ArrayPtr<TaskPtr> &tasks, const CancellationToken &cancellationToken)

Arguments

ParameterTypeDescription
tasksconst ArrayPtr<TaskPtr>&An array of Task instances on which to wait.
cancellationTokenconst CancellationToken&A CancellationToken to observe while waiting for the tasks to complete.

Return Value

The index of the completed task in the tasks array.

System::Threading::Tasks::WaitAny(const ArrayPtr<TaskPtr>&) function

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

int32_t System::Threading::Tasks::WaitAny(const ArrayPtr<TaskPtr> &tasks)

Arguments

ParameterTypeDescription
tasksconst ArrayPtr<TaskPtr>&An array of Task instances on which to wait.

Return Value

The index of the completed task in the tasks array.

See Also