Threading and locked objects

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
 
A

Alvin Bruney [MVP]

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
 
J

Jako Menkveld

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top