开发者

C# Threading: What's the difference between Block and WaitSleepJoin?

开发者 https://www.devze.com 2023-01-31 14:01 出处:网络
This is in reference to a thread\'s state. Is there a difference be开发者_Python百科tween a thread being Blocked and a thread being in a WaitSleepJoin state, or are they one in the same?

This is in reference to a thread's state.

Is there a difference be开发者_Python百科tween a thread being Blocked and a thread being in a WaitSleepJoin state, or are they one in the same?

Thanks


The ThreadState enumeration (System.Threading) doesn't have a Blocked state.

From MSDN:

  • WaitSleepJoin - The thread is blocked. This could be the result of calling Thread.Sleep or Thread.Join, of requesting a lock — for example, by calling Monitor.Enter or Monitor.Wait — or of waiting on a thread synchronization object such as ManualResetEvent.

The System.Diagnostics.ThreadState enumeration doesn't have a Blocked or a WaitSleepJoin member.

0

精彩评论

暂无评论...
验证码 换一张
取 消