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>
259
if ((ThreadState &
ThreadState
.Unstarted) != 0)
283
if ((ThreadState &
ThreadState
.Unstarted) == 0)
418
Debug.Assert(ThreadState.HasFlag(
ThreadState
.Unstarted) || this == CurrentThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.Unix.cs (1)
47
Debug.Assert((ThreadState &
ThreadState
.Unstarted) == 0 || (millisecondsTimeout == 0));
System\Threading\Thread.NativeAot.cs (48)
20
private const
ThreadState
ThreadPoolThread = (
ThreadState
)0x1000;
26
private const
ThreadState
PublicThreadStateMask = (
ThreadState
)0x1FF;
31
private volatile int _threadState = (int)
ThreadState
.Unstarted;
92
Debug.Assert(currentThread._threadState == (int)
ThreadState
.Unstarted);
94
ThreadState
state = 0;
99
state |=
ThreadState
.Background;
106
currentThread._threadState = (int)(state |
ThreadState
.Running);
119
return !GetThreadStateBit(
ThreadState
.Unstarted);
126
return ((
ThreadState
)_threadState & (
ThreadState
.Unstarted |
ThreadState
.Stopped |
ThreadState
.Aborted)) == 0;
132
return ((
ThreadState
)_threadState & (
ThreadState
.Stopped |
ThreadState
.Aborted)) != 0;
143
return GetThreadStateBit(
ThreadState
.Background);
155
int threadState = SetThreadStateBit(
ThreadState
.Background);
157
if ((threadState & ((int)
ThreadState
.Background | (int)
ThreadState
.Unstarted | (int)
ThreadState
.Stopped)) == 0)
164
int threadState = ClearThreadStateBit(
ThreadState
.Background);
166
if ((threadState & ((int)
ThreadState
.Background | (int)
ThreadState
.Unstarted | (int)
ThreadState
.Stopped)) == (int)
ThreadState
.Background)
268
public
ThreadState
ThreadState => ((
ThreadState
)_threadState & PublicThreadStateMask);
270
private bool GetThreadStateBit(
ThreadState
bit)
272
Debug.Assert((bit &
ThreadState
.Stopped) == 0, "ThreadState.Stopped bit may be stale; use GetThreadState instead.");
276
private int SetThreadStateBit(
ThreadState
bit)
281
private int ClearThreadStateBit(
ThreadState
bit)
289
Debug.Assert(!GetThreadStateBit(
ThreadState
.WaitSleepJoin));
291
SetThreadStateBit(
ThreadState
.WaitSleepJoin);
297
Debug.Assert(GetThreadStateBit(
ThreadState
.WaitSleepJoin));
299
ClearThreadStateBit(
ThreadState
.WaitSleepJoin);
360
if (!GetThreadStateBit(
ThreadState
.Unstarted))
379
while (GetThreadStateBit(
ThreadState
.Unstarted) && !JoinInternal(0))
395
if (GetThreadStateBit(
ThreadState
.Unstarted))
431
int state = thread.ClearThreadStateBit(
ThreadState
.Unstarted);
432
if ((state & (int)
ThreadState
.Background) == 0)
451
thread.SetThreadStateBit(
ThreadState
.Stopped);
457
if ((thread._threadState & (int)(
ThreadState
.Stopped |
ThreadState
.Aborted)) == 0)
459
thread.SetThreadStateBit(
ThreadState
.Stopped);
462
int state = thread.ClearThreadStateBit(
ThreadState
.Background);
463
if ((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
))]