1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
|
<?xml version="1.0" encoding="utf-8"?>
<Type Name="ThreadState" FullName="System.Threading.ThreadState" FullNameSP="System_Threading_ThreadState" Maintainer="ecma">
<TypeSignature Language="ILASM" Value=".class public sealed serializable ThreadState extends System.Enum" />
<TypeSignature Language="C#" Value="public enum ThreadState" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed ThreadState extends System.Enum" />
<MemberOfLibrary>BCL</MemberOfLibrary>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Enum</BaseTypeName>
</Base>
<Attributes>
<Attribute>
<AttributeName>System.Flags</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="T:System.Threading.ThreadState" /> enumeration is of interest only in a few debugging scenarios. Your code should never use the thread state to synchronize the activities of threads.</para>
<para>
<see cref="T:System.Threading.ThreadState" /> defines a set of all possible execution states for threads. Once a thread is created, it is in at least one of the states until it terminates. Threads created within the common language runtime are initially in the Unstarted state, while external threads that come into the runtime are already in the Running state. An Unstarted thread is transitioned into the Running state by calling <see cref="M:System.Threading.Thread.Start" />. Not all combinations of ThreadState values are valid; for example, a thread cannot be in both the Aborted and Unstarted states.</para>
<block subset="none" type="note">
<para>There are two thread state enumerations, <see cref="T:System.Threading.ThreadState" /> and <see cref="T:System.Diagnostics.ThreadState" />.</para>
</block>
<para>The following table shows the actions that cause a change of state.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Action </para>
</term>
<description>
<para>ThreadState </para>
</description>
</item>
</listheader>
<item>
<term>
<para>A thread is created within the common language runtime. </para>
</term>
<description>
<para>Unstarted </para>
</description>
</item>
<item>
<term>
<para>Another thread calls the <see cref="M:System.Threading.Thread.Start" /> method on the new thread, and the call returns. </para>
<para>The <see cref="M:System.Threading.Thread.Start" /> method does not return until the new thread has started running. There is no way to know at what point the new thread will start running, during the call to <see cref="M:System.Threading.Thread.Start" />.</para>
</term>
<description>
<para>Running </para>
</description>
</item>
<item>
<term>
<para>The thread calls <see cref="M:System.Threading.Thread.Sleep(System.Int32)" /></para>
</term>
<description>
<para>WaitSleepJoin </para>
</description>
</item>
<item>
<term>
<para>The thread calls <see cref="M:System.Threading.Monitor.Wait(System.Object,System.Int32,System.Boolean)" /> on another object. </para>
</term>
<description>
<para>WaitSleepJoin </para>
</description>
</item>
<item>
<term>
<para>The thread calls <see cref="M:System.Threading.Thread.Join" /> on another thread. </para>
</term>
<description>
<para>WaitSleepJoin </para>
</description>
</item>
<item>
<term>
<para>Another thread calls <see cref="M:System.Threading.Thread.Interrupt" /></para>
</term>
<description>
<para>Running </para>
</description>
</item>
<item>
<term>
<para>Another thread calls <see cref="M:System.Threading.Thread.Suspend" /></para>
</term>
<description>
<para>SuspendRequested </para>
</description>
</item>
<item>
<term>
<para>The thread responds to a <see cref="M:System.Threading.Thread.Suspend" /> request. </para>
</term>
<description>
<para>Suspended </para>
</description>
</item>
<item>
<term>
<para>Another thread calls <see cref="M:System.Threading.Thread.Resume" /></para>
</term>
<description>
<para>Running </para>
</description>
</item>
<item>
<term>
<para>Another thread calls <see cref="M:System.Threading.Thread.Abort(System.Object)" /></para>
</term>
<description>
<para>AbortRequested </para>
</description>
</item>
<item>
<term>
<para>The thread responds to a <see cref="M:System.Threading.Thread.Abort(System.Object)" /> request. </para>
</term>
<description>
<para>Stopped </para>
</description>
</item>
<item>
<term>
<para>A thread is terminated. </para>
</term>
<description>
<para>Stopped </para>
</description>
</item>
</list>
<para>In addition to the states noted above, there is also the Background state, which indicates whether the thread is running in the background or foreground.</para>
<para>A thread can be in more than one state at a given time. For example, if a thread is blocked on a call to <see cref="M:System.Threading.Monitor.Wait(System.Object,System.Int32,System.Boolean)" />, and another thread calls <see cref="M:System.Threading.Thread.Abort(System.Object)" /> on the blocked thread, the blocked thread will be in both the WaitSleepJoin and the AbortRequested states at the same time. In this case, as soon as the thread returns from the call to <see cref="M:System.Threading.Monitor.Wait(System.Object,System.Int32,System.Boolean)" /> or is interrupted, it will receive the <see cref="T:System.Threading.ThreadAbortException" /> to begin aborting.</para>
<para>The <see cref="P:System.Threading.Thread.ThreadState" /> property of a thread provides the current state of a thread. Applications must use a bitmask to determine whether a thread is running. Since the value for Running is zero (0), test whether a thread is running by using C# code such as (myThread.ThreadState & (ThreadState.Stopped | ThreadState.Unstarted)) == 0 or Visual Basic code such as (myThread.ThreadState And (ThreadState.Stopped Or ThreadState.Unstarted)) = 0.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies the execution states of a <see cref="T:System.Threading.Thread" />.</para>
</summary>
</Docs>
<Members>
<Member MemberName="Aborted">
<MemberSignature Language="ILASM" Value=".field public static literal valuetype System.Threading.ThreadState Aborted = 0x100" />
<MemberSignature Language="C#" Value="Aborted" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState Aborted = int32(256)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<Parameters />
<MemberValue>Aborted</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread state includes <see cref="F:System.Threading.ThreadState.AbortRequested" /> and the thread is now dead, but its state has not yet changed to <see cref="F:System.Threading.ThreadState.Stopped" />.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="AbortRequested">
<MemberSignature Language="ILASM" Value=".field public static literal valuetype System.Threading.ThreadState AbortRequested = 0x80" />
<MemberSignature Language="C#" Value="AbortRequested" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState AbortRequested = int32(128)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<Parameters />
<MemberValue>AbortRequested</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Threading.Thread.Abort(System.Object)" /> method has been invoked on the thread, but the thread has not yet received the pending <see cref="T:System.Threading.ThreadAbortException" /> that will attempt to terminate it.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Background">
<MemberSignature Language="ILASM" Value=".field public static literal valuetype System.Threading.ThreadState Background = 0x4" />
<MemberSignature Language="C#" Value="Background" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState Background = int32(4)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<Parameters />
<MemberValue>Background</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread is being executed as a background thread, as opposed to a foreground thread. This state is controlled by setting the <see cref="P:System.Threading.Thread.IsBackground" /> property.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Running">
<MemberSignature Language="ILASM" Value=".field public static literal valuetype System.Threading.ThreadState Running = 0x0" />
<MemberSignature Language="C#" Value="Running" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState Running = int32(0)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<Parameters />
<MemberValue>Running</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread has been started, it is not blocked, and there is no pending <see cref="T:System.Threading.ThreadAbortException" />.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Stopped">
<MemberSignature Language="ILASM" Value=".field public static literal valuetype System.Threading.ThreadState Stopped = 0x10" />
<MemberSignature Language="C#" Value="Stopped" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState Stopped = int32(16)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<Parameters />
<MemberValue>Stopped</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread has stopped.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="StopRequested">
<MemberSignature Language="C#" Value="StopRequested" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState StopRequested = int32(1)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<MemberValue>StopRequested</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread is being requested to stop. This is for internal use only.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Suspended">
<MemberSignature Language="C#" Value="Suspended" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState Suspended = int32(64)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<MemberValue>Suspended</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread has been suspended.</para>
</summary>
</Docs>
</Member>
<Member MemberName="SuspendRequested">
<MemberSignature Language="C#" Value="SuspendRequested" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState SuspendRequested = int32(2)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<MemberValue>SuspendRequested</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread is being requested to suspend.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Unstarted">
<MemberSignature Language="ILASM" Value=".field public static literal valuetype System.Threading.ThreadState Unstarted = 0x8" />
<MemberSignature Language="C#" Value="Unstarted" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState Unstarted = int32(8)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<Parameters />
<MemberValue>Unstarted</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Threading.Thread.Start" /> method has not been invoked on the thread.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="WaitSleepJoin">
<MemberSignature Language="ILASM" Value=".field public static literal valuetype System.Threading.ThreadState WaitSleepJoin = 0x20" />
<MemberSignature Language="C#" Value="WaitSleepJoin" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Threading.ThreadState WaitSleepJoin = int32(32)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.ThreadState</ReturnType>
</ReturnValue>
<Parameters />
<MemberValue>WaitSleepJoin</MemberValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The thread is blocked. This could be the result of calling <see cref="M:System.Threading.Thread.Sleep(System.Int32)" /> or <see cref="M:System.Threading.Thread.Join" />, of requesting a lock — for example, by calling <see cref="M:System.Threading.Monitor.Enter(System.Object)" /> or <see cref="M:System.Threading.Monitor.Wait(System.Object,System.Int32,System.Boolean)" /> — or of waiting on a thread synchronization object such as <see cref="T:System.Threading.ManualResetEvent" />. </para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
</Members>
<TypeExcluded>0</TypeExcluded>
</Type>
|