Sharon,
Interrupt is the only thing that will stop the blocking. The only other
thing I could think of that would stop it would be to actually find the
object that is currently holding the lock, and release it on the thread that
is holding it. However, that doesn't guarantee that your thread will wake
up, because there might be other threads trying to lock on that same object.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Sharon" <Sh****@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
I'm writing a thread wrapper for a safe thread termination by using stop
event.
Whenever the thread stop event is signaled, I want to release the thread
in
case it's blocked on Monitor.Enter() or Monitor.Wait().
Note that when I'm writing this code, I do not know on what object the
Monitor will block on.
Is there a way to release the thread from the Monitor blocking except
using
Thread.Interrupt() (Any kind of wrapping is acceptable) ???
--
Thanks
Sharon G.