Threading and locked objects

  • Thread starter Thread starter Jako Menkveld
  • Start date Start date
J

Jako Menkveld

Is it possible to determine the thread id of the thread that currently holds
a lock on an object?

I need to do this while debugging because for some reason I get a deadlock
and I'm trying to find out where it comes from.

Any help would really be appreciated!

Thanks
Jako
 
You can do this from the thread watch window, it will display the id of the
currently executing thread. If you suspect the culprit thread, you can
freeze the other executing threads and then follow the execution path of the
culprit thread to isolate the error.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
 
Alvin

Thanks for that, I'll give it a try.

Cheers
Jako

Alvin Bruney said:
You can do this from the thread watch window, it will display the id of
the currently executing thread. If you suspect the culprit thread, you can
freeze the other executing threads and then follow the execution path of
the culprit thread to isolate the error.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------


Jako Menkveld said:
Is it possible to determine the thread id of the thread that currently
holds a lock on an object?

I need to do this while debugging because for some reason I get a
deadlock and I'm trying to find out where it comes from.

Any help would really be appreciated!

Thanks
Jako
 
Back
Top