task_continuation_context Class

The task_continuation_context class allows you to specify where you would like a continuation to be executed. You use this class only in a Windows Store app. For desktop apps, the task continuation's execution context is determined by the runtime, and isn’t configurable.

class task_continuation_context : public details::_ContextCallback;


Public Methods



task_continuation_context::use_arbitrary Method

Creates a task continuation context which allows the runtime to choose the execution context for a continuation.

task_continuation_context::use_current Method

Returns a task continuation context object that represents the current execution context.

task_continuation_context::use_default Method

Creates the default task continuation context.


A task that's created from an asynchronous operation, such as Windows::Foundation::IAsyncOperation<TResult>, uses special semantics that can help you ignore the threading details. Although an operation might run on a background thread (or it may not be backed by a thread at all), its continuations are by default guaranteed to run on the apartment that started the continuation operations (in other words, from the apartment that called concurrency::task::then). You can use the task_continuation_context class to control the execution context of a continuation. For more info, see Creating Asynchronous Operations in C++ for Windows Store Apps.

Inheritance Hierarchy




Header: ppltasks.h

Namespace: concurrency

See Also


concurrency Namespace

task Class (Concurrency Runtime)