59 references to ThreadState
mscorlib (1)
parent\ref\mscorlib.cs (1)
1181[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadState))]
netstandard (1)
netstandard.cs (1)
2144[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadState))]
System.Private.CoreLib (56)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (7)
172/// <summary>Causes the operating system to change the state of the current instance to <see cref="ThreadState.Running"/>, and optionally supplies an object containing data to be used by the method the thread executes.</summary> 182/// <summary>Causes the operating system to change the state of the current instance to <see cref="ThreadState.Running"/>, and optionally supplies an object containing data to be used by the method the thread executes.</summary> 219/// <summary>Causes the operating system to change the state of the current instance to <see cref="ThreadState.Running"/>.</summary> 227/// <summary>Causes the operating system to change the state of the current instance to <see cref="ThreadState.Running"/>.</summary> 259if ((ThreadState & ThreadState.Unstarted) != 0) 283if ((ThreadState & ThreadState.Unstarted) == 0) 418Debug.Assert(ThreadState.HasFlag(ThreadState.Unstarted) || this == CurrentThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.Unix.cs (1)
47Debug.Assert((ThreadState & ThreadState.Unstarted) == 0 || (millisecondsTimeout == 0));
System\Threading\Thread.NativeAot.cs (48)
20private const ThreadState ThreadPoolThread = (ThreadState)0x1000; 26private const ThreadState PublicThreadStateMask = (ThreadState)0x1FF; 31private volatile int _threadState = (int)ThreadState.Unstarted; 92Debug.Assert(currentThread._threadState == (int)ThreadState.Unstarted); 94ThreadState state = 0; 99state |= ThreadState.Background; 106currentThread._threadState = (int)(state | ThreadState.Running); 119return !GetThreadStateBit(ThreadState.Unstarted); 126return ((ThreadState)_threadState & (ThreadState.Unstarted | ThreadState.Stopped | ThreadState.Aborted)) == 0; 132return ((ThreadState)_threadState & (ThreadState.Stopped | ThreadState.Aborted)) != 0; 143return GetThreadStateBit(ThreadState.Background); 155int threadState = SetThreadStateBit(ThreadState.Background); 157if ((threadState & ((int)ThreadState.Background | (int)ThreadState.Unstarted | (int)ThreadState.Stopped)) == 0) 164int threadState = ClearThreadStateBit(ThreadState.Background); 166if ((threadState & ((int)ThreadState.Background | (int)ThreadState.Unstarted | (int)ThreadState.Stopped)) == (int)ThreadState.Background) 268public ThreadState ThreadState => ((ThreadState)_threadState & PublicThreadStateMask); 270private bool GetThreadStateBit(ThreadState bit) 272Debug.Assert((bit & ThreadState.Stopped) == 0, "ThreadState.Stopped bit may be stale; use GetThreadState instead."); 276private int SetThreadStateBit(ThreadState bit) 281private int ClearThreadStateBit(ThreadState bit) 289Debug.Assert(!GetThreadStateBit(ThreadState.WaitSleepJoin)); 291SetThreadStateBit(ThreadState.WaitSleepJoin); 297Debug.Assert(GetThreadStateBit(ThreadState.WaitSleepJoin)); 299ClearThreadStateBit(ThreadState.WaitSleepJoin); 360if (!GetThreadStateBit(ThreadState.Unstarted)) 379while (GetThreadStateBit(ThreadState.Unstarted) && !JoinInternal(0)) 395if (GetThreadStateBit(ThreadState.Unstarted)) 431int state = thread.ClearThreadStateBit(ThreadState.Unstarted); 432if ((state & (int)ThreadState.Background) == 0) 451thread.SetThreadStateBit(ThreadState.Stopped); 457if ((thread._threadState & (int)(ThreadState.Stopped | ThreadState.Aborted)) == 0) 459thread.SetThreadStateBit(ThreadState.Stopped); 462int state = thread.ClearThreadStateBit(ThreadState.Background); 463if ((state & (int)ThreadState.Background) == 0)
System.Threading.Thread (1)
src\runtime\artifacts\obj\System.Threading.Thread\Release\net11.0\System.Threading.Thread.Forwards.cs (1)
15[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadState))]