Compare CurrentThread from ProcessThread.Id
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.
精彩评论