System::Threading::Tasks::WaitAny method

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

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

int32_t System::Threading::Tasks::WaitAny(const ArrayPtr<TaskPtr> &tasks)
ParameterTypeDescription
tasksconst ArrayPtr<TaskPtr>&An array of Task instances on which to wait.

ReturnValue

The index of the completed task in the tasks array.

See Also

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

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

int32_t System::Threading::Tasks::WaitAny(const ArrayPtr<TaskPtr> &tasks, const CancellationToken &cancellationToken)
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.

ReturnValue

The index of the completed task in the tasks array.

See Also