Compartilhar via


VsTaskContinuationOptions Enum

Definition

Managed definition of __VSTASKCONTINUATIONOPTIONS/__VSTASKCONTINUATIONOPTIONS2.

This enumeration supports a bitwise combination of its member values.

public enum class VsTaskContinuationOptions
public enum class VsTaskContinuationOptions
enum VsTaskContinuationOptions
[System.Flags]
public enum VsTaskContinuationOptions
[<System.Flags>]
type VsTaskContinuationOptions = 
Public Enum VsTaskContinuationOptions
Inheritance
VsTaskContinuationOptions
Attributes

Fields

Name Value Description
NotCancelable -2147483648

Marks the task as not cancelable. Users will get exception if they try to cancel the task.

None 0

Default = "Continue on any, no task options, run asynchronously" Specifies that the default behavior should be used. Continuations, by default, are scheduled when the antecedent task completes, regardless of the task's final state.

PreferFairness 1

A hint to the task library to schedule a task in as fair a manner as possible, meaning that tasks scheduled sooner are more likely to be run sooner, and tasks scheduled later are more likely to be run later.

LongRunning 2

For background tasks, this will cause the task to run its own thread instead of thread pool.

AttachedToParent 4

Creates the task as attached to the currently running task. The parent task will not be marked as completed until this task is completed as well.

DenyChildAttach 8

An InvalidOperationException is thrown if an attempt is made to attach a child task to the created task.

LazyCancelation 32

In the case of continuation cancellation, prevents completion of the continuation until the antecedent has completed.

NotOnRanToCompletion 65536

The continuation task should not be scheduled if its antecedent ran to completion. This option is not valid for multi-task continuations.

Default 131072

The same as NotOnFaulted.

NotOnFaulted 131072

The continuation task should not be scheduled if its antecedent threw an unhandled exception. This option is not valid for multi-task continuations.

OnlyOnCanceled 196608
NotOnCanceled 262144

The continuation task should not be scheduled if its antecedent was canceled. This option is not valid for multi-task continuations.

OnlyOnFaulted 327680

The continuation task should be scheduled only if its antecedent threw an unhandled exception. This option is not valid for multi-task continuations.

OnlyOnRanToCompletion 393216

The continuation task should be scheduled only if its antecedent ran to completion. This option is not valid for multi-task continuations.

ExecuteSynchronously 524288

This option is not supported by the VS task library and it will be ignored hence continuations will not be inlined.

CancelWithParent 536870912

Cancels the task when its parent is canceled.

IndependentlyCanceled 1073741824

Separates the continuation task's cancelation so that it can be canceled independently. So canceling the current task doesn't cancel the continuation task and it executes in the order it is scheduled.

Applies to