Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
341 lines (335 sloc) 16.3 KB
<Type Name="TaskStatus" FullName="System.Threading.Tasks.TaskStatus">
<TypeSignature Language="C#" Value="public enum TaskStatus" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed TaskStatus extends System.Enum" />
<TypeSignature Language="DocId" Value="T:System.Threading.Tasks.TaskStatus" />
<TypeSignature Language="VB.NET" Value="Public Enum TaskStatus" />
<TypeSignature Language="C++ CLI" Value="public enum class TaskStatus" />
<TypeSignature Language="F#" Value="type TaskStatus = " />
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Enum</BaseTypeName>
</Base>
<Docs>
<summary>Represents the current stage in the lifecycle of a <see cref="T:System.Threading.Tasks.Task" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Threading.Tasks.Task.Status%2A?displayProperty=nameWithType> property returns a member of the <xref:System.Threading.Tasks.TaskStatus> enumeration to indicate the task's current status.
## Examples
The following example creates 20 tasks that will loop until a counter is incremented to a value of 2 million. When the first 10 tasks reach 2 million, the cancellation token is cancelled, and any tasks whose counters have not reached 2 million are cancelled. The example then examines the <xref:System.Threading.Tasks.Task.Status%2A?displayProperty=nameWithType> property of each task to indicate whether the task has completed successfully or been cancelled. For those that have completed, it displays the value returned by the task.
[!code-csharp[System.Threading.Tasks.Task.Run#7](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.threading.tasks.task.run/cs/Run7.cs#7)]
[!code-vb[System.Threading.Tasks.Task.Run#7](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.threading.tasks.task.run/vb/Run7.vb#7)]
]]></format>
</remarks>
<altmember cref="P:System.Threading.Tasks.Task.Status" />
</Docs>
<Members>
<Member MemberName="Canceled">
<MemberSignature Language="C#" Value="Canceled" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus Canceled = int32(6)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.Canceled" />
<MemberSignature Language="VB.NET" Value="Canceled" />
<MemberSignature Language="C++ CLI" Value="Canceled" />
<MemberSignature Language="F#" Value="Canceled = 6" Usage="System.Threading.Tasks.TaskStatus.Canceled" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>6</MemberValue>
<Docs>
<summary>The task acknowledged cancellation by throwing an OperationCanceledException with its own CancellationToken while the token was in signaled state, or the task's CancellationToken was already signaled before the task started executing. For more information, see [Task Cancellation](~/docs/standard/parallel-programming/task-cancellation.md).</summary>
</Docs>
</Member>
<Member MemberName="Created">
<MemberSignature Language="C#" Value="Created" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus Created = int32(0)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.Created" />
<MemberSignature Language="VB.NET" Value="Created" />
<MemberSignature Language="C++ CLI" Value="Created" />
<MemberSignature Language="F#" Value="Created = 0" Usage="System.Threading.Tasks.TaskStatus.Created" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>0</MemberValue>
<Docs>
<summary>The task has been initialized but has not yet been scheduled.</summary>
</Docs>
</Member>
<Member MemberName="Faulted">
<MemberSignature Language="C#" Value="Faulted" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus Faulted = int32(7)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.Faulted" />
<MemberSignature Language="VB.NET" Value="Faulted" />
<MemberSignature Language="C++ CLI" Value="Faulted" />
<MemberSignature Language="F#" Value="Faulted = 7" Usage="System.Threading.Tasks.TaskStatus.Faulted" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>7</MemberValue>
<Docs>
<summary>The task completed due to an unhandled exception.</summary>
</Docs>
</Member>
<Member MemberName="RanToCompletion">
<MemberSignature Language="C#" Value="RanToCompletion" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus RanToCompletion = int32(5)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.RanToCompletion" />
<MemberSignature Language="VB.NET" Value="RanToCompletion" />
<MemberSignature Language="C++ CLI" Value="RanToCompletion" />
<MemberSignature Language="F#" Value="RanToCompletion = 5" Usage="System.Threading.Tasks.TaskStatus.RanToCompletion" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>5</MemberValue>
<Docs>
<summary>The task completed execution successfully.</summary>
</Docs>
</Member>
<Member MemberName="Running">
<MemberSignature Language="C#" Value="Running" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus Running = int32(3)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.Running" />
<MemberSignature Language="VB.NET" Value="Running" />
<MemberSignature Language="C++ CLI" Value="Running" />
<MemberSignature Language="F#" Value="Running = 3" Usage="System.Threading.Tasks.TaskStatus.Running" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>3</MemberValue>
<Docs>
<summary>The task is running but has not yet completed.</summary>
</Docs>
</Member>
<Member MemberName="WaitingForActivation">
<MemberSignature Language="C#" Value="WaitingForActivation" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus WaitingForActivation = int32(1)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.WaitingForActivation" />
<MemberSignature Language="VB.NET" Value="WaitingForActivation" />
<MemberSignature Language="C++ CLI" Value="WaitingForActivation" />
<MemberSignature Language="F#" Value="WaitingForActivation = 1" Usage="System.Threading.Tasks.TaskStatus.WaitingForActivation" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>1</MemberValue>
<Docs>
<summary>The task is waiting to be activated and scheduled internally by the .NET Framework infrastructure.</summary>
</Docs>
</Member>
<Member MemberName="WaitingForChildrenToComplete">
<MemberSignature Language="C#" Value="WaitingForChildrenToComplete" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus WaitingForChildrenToComplete = int32(4)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.WaitingForChildrenToComplete" />
<MemberSignature Language="VB.NET" Value="WaitingForChildrenToComplete" />
<MemberSignature Language="C++ CLI" Value="WaitingForChildrenToComplete" />
<MemberSignature Language="F#" Value="WaitingForChildrenToComplete = 4" Usage="System.Threading.Tasks.TaskStatus.WaitingForChildrenToComplete" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>4</MemberValue>
<Docs>
<summary>The task has finished executing and is implicitly waiting for attached child tasks to complete.</summary>
</Docs>
</Member>
<Member MemberName="WaitingToRun">
<MemberSignature Language="C#" Value="WaitingToRun" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.Tasks.TaskStatus WaitingToRun = int32(2)" />
<MemberSignature Language="DocId" Value="F:System.Threading.Tasks.TaskStatus.WaitingToRun" />
<MemberSignature Language="VB.NET" Value="WaitingToRun" />
<MemberSignature Language="C++ CLI" Value="WaitingToRun" />
<MemberSignature Language="F#" Value="WaitingToRun = 2" Usage="System.Threading.Tasks.TaskStatus.WaitingToRun" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.TaskStatus</ReturnType>
</ReturnValue>
<MemberValue>2</MemberValue>
<Docs>
<summary>The task has been scheduled for execution but has not yet begun executing.</summary>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.