Waits for this task to reach a terminal state. It is possible for wait to execute the task inline, if all of the tasks dependencies are satisfied, and it has not already been picked up for execution by a background worker.
In a Windows Store app, do not call wait in code that runs on the STA. Otherwise, the runtime throws concurrency::invalid_operation because this method blocks the current thread and can cause the app to become unresponsive. However, you can call the concurrency::task::get method to receive the result of the antecedent task in a task-based continuation.