Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

task_group::wait Method

Waits until all work on the task_group object has either completed or been canceled.

task_group_status wait();

An indication of whether the wait was satisfied or the task group was canceled, due to either an explicit cancel operation or an exception being thrown from one of its tasks. For more information, see task_group_status.

Note that one or more of the tasks scheduled to this task_group object may execute inline on the calling context.

If one or more of the tasks scheduled to this task_group object throws an exception, the runtime will select one such exception of its choosing and propagate it out of the call to the wait method.

Calling wait on a task_group object resets it to a clean state where it can be reused. This includes the case where the task_group object was canceled.

In the non-exceptional path of execution, you have a mandate to call either this method or the run_and_wait method before the destructor of the task_group executes.

Header: ppl.h

Namespace: concurrency

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.