Reputation: 101166
How can I check if CurrentThread
is the one specified by ProcessThread.Id
?
Upvotes: 1
Views: 116
Reputation: 942030
.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.
Upvotes: 3