开发者

Compare CurrentThread from ProcessThread.Id

开发者 https://www.devze.com 2023-03-14 11:06 出处:网络
开发者_运维百科How can I check if CurrentThread is the one specified by ProcessThread.Id?.NET stops you from assuming that a Thread is actually an operating system thread.It is on any shipping version
开发者_运维百科

How can I check if CurrentThread is the one specified by ProcessThread.Id?


.NET stops you from assuming that a Thread is actually an operating system thread. It is on any shipping version of the CLR but that was not originally the plan. A project in the SQL Server team to implement Thread on top of a fiber failed. You'll have to pinvoke GetCurrentThreadId(). Visit pinvoke.net for the declaration.

0

精彩评论

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