Compartir a través de


cancel_current_task Function (C++ REST SDK)

Cancels the currently executing task. This function can be called from within the body of a task to abort the task's execution and cause it to enter the canceled state. While it may be used in response to the is_task_cancellation_requested function, you may also use it by itself, to initiate cancellation of the task that is currently executing.

It is not a supported scenario to call this function if you are not within the body of a task. Doing so will result in undefined behavior such as a crash or a hang in your application.

Warning

This topic contains information for the C++ REST SDK 1.0 (codename "Casablanca"). If you are using a later version from the Codeplex Casablanca web page, then use the local documentation at http://casablanca.codeplex.com/documentation.

inline __declspec(
   noreturn
) void __cdecl cancel_current_task();

Requirements

Header: pplxtasks.h

Namespace: pplx

See Also

Reference

pplx Namespace

task Class