BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 System.Enum System.Flags System.Runtime.InteropServices.ComVisible(true)

Specifies the execution states of a .

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 values are valid; for example, a thread cannot be in both the and states.

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

Action
ThreadState after Action
The thread is created
Unstarted
is invoked on the thread
Running
The thread calls
WaitSleepJoin
The thread calls to wait on an object
WaitSleepJoin
The thread calls to wait for another thread to terminate
WaitSleepJoin
The delegate methods finish executing
Stopped
Another thread requests the thread to
AbortRequested
The thread accepts a request
Aborted

In addition to the states noted above, there is also the state, which indicates whether the thread is running in the background or foreground.

The current state of a thread can be retrieved from the property, whose value is a combination of the values. Once a thread has reached the state, it cannot change to any other state.

- Field
  System.Threading.ThreadState Aborted

  The thread represented by an instance of has terminated as a result of a call to . A thread in this state is also in the state.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState AbortRequested

  The method has been invoked on the thread, but the thread has not yet received the pending that will attempt to terminate it.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState Background

  The thread represented by an instance of is being executed as a background thread, as opposed to a foreground thread. This state is controlled by setting the property.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState Running

  The thread represented by an instance of has been started and has not terminated.

  To determine if a thread is running, check that its state does not include and does not include .

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState Stopped

  The thread represented by an instance of has terminated.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState StopRequested To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState Suspended To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState SuspendRequested To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState Unstarted

  The method has not been invoked on the thread.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.Threading.ThreadState WaitSleepJoin

  The thread represented by an instance of is blocked as a result of a call to , , or .

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
0