Is there a way to check within someObj.someMethod() if it is being executed on the same thread on which someObj was created? This could save me a debugging headache later on if I mess up certain concurrency constraints.
Is there a way to check within someObj.someMethod() if it is being executed on
Share
The only way to do that is to store the thread-id when you create it. On .NET 4.5:
then check against that same term in
someMethod.Note that on other framework versions, you might need:
instead.