Description

System.Threading.ThreadState defines the set of possible execution states for threads. Once a thread is created, it is in one or more of these states until it terminates. Not all combinations of ThreadState values are valid; for example, a thread cannot be in both the System.Threading.ThreadState.Stopped and System.Threading.ThreadState.Unstarted states.

The following table shows the actions that cause a thread to change state.

ActionThreadState after Action
The thread is created.Unstarted
System.Threading.Thread.Start is invoked on the thread.Running
The thread calls System.Threading.Thread.Sleep.WaitSleepJoin
The thread calls System.Threading.Monitor.Wait to wait on an object.WaitSleepJoin
The thread calls System.Threading.Thread.Join ...

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.