B
Bob
For debug purposes, I need to figure out if the current thread has a lock on
an object. Ideally I would like to determine this without using multiple
threads.
The closest I can get is to Monitor.TryEnter(obj)/Exit which tells me
whether or not the current thread /can/ acquire a lock on the object, but it
does not tell me if it currently /does/ have a lock on the object. I am
capable of doing this with some multithreaded trickery but I don't want to
do that.
I found the sources for JIT_MonTryEnter in clr\src\vm\i386\jithelp.asm and
it is doing some interesting stuff in there... which leads me to believe
this is not going to be possible.
Anybody of a way?
an object. Ideally I would like to determine this without using multiple
threads.
The closest I can get is to Monitor.TryEnter(obj)/Exit which tells me
whether or not the current thread /can/ acquire a lock on the object, but it
does not tell me if it currently /does/ have a lock on the object. I am
capable of doing this with some multithreaded trickery but I don't want to
do that.
I found the sources for JIT_MonTryEnter in clr\src\vm\i386\jithelp.asm and
it is doing some interesting stuff in there... which leads me to believe
this is not going to be possible.
Anybody of a way?