线程状态有哪些枚举值

public enum ThreadState
{
//线程已启动,但尚未停止。
// 摘要:
// The thread has been started and not yet stopped.
Running = 0,
//
// 摘要:正在请求停止线程。仅供内部使用。
// The thread is being requested to stop. This is for internal use only.
StopRequested = 1,
//
// 摘要:正在请求线程挂起
// The thread is being requested to suspend.
SuspendRequested = 2,
//线程作为后台线程执行,而不是前台线程
// 摘要:
// The thread is being executed as a background thread, as opposed to a foreground
// thread. This state is controlled by setting the System.Threading.Thread.IsBackground
// property.
Background = 4,
//
// 摘要:尚未在线程上调用System.Threading.Thread.Start方法。
// The System.Threading.Thread.Start method has not been invoked on the thread.
Unstarted = 8,
//
// 摘要:
// The thread has stopped.
Stopped = 16,
//
// 摘要:线程被阻塞。这可能是调用System.Threading.Thread.Sleep(System.Int32)的结果
// The thread is blocked. This could be the result of calling System.Threading.Thread.Sleep(System.Int32)
// or System.Threading.Thread.Join, of requesting a lock - for example, by calling
// System.Threading.Monitor.Enter(System.Object) or System.Threading.Monitor.Wait(System.Object,System.Int32,System.Boolean)
// - or of waiting on a thread synchronization object such as System.Threading.ManualResetEvent.
WaitSleepJoin = 32,
//
// 摘要:
// The thread has been suspended.
Suspended = 64,
//已在上调用System.Threading.Thread.Abort(System.Object)方法

//线程,但该线程尚未收到挂起的System.Threading.ThreadAbortException

//这将试图终止它。
// 摘要:
// The System.Threading.Thread.Abort(System.Object) method has been invoked on the
// thread, but the thread has not yet received the pending System.Threading.ThreadAbortException
// that will attempt to terminate it.
AbortRequested = 128,
//
// 摘要:线程状态包括System.Threading.ThreadState.AbortRequested和

//线程现在已停止,但其状态尚未更改为System.Threading.ThreadState.Stopped。
// The thread state includes System.Threading.ThreadState.AbortRequested and the
// thread is now dead, but its state has not yet changed to System.Threading.ThreadState.Stopped.
Aborted = 256
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值