G
Guest
Hey guys,
I'm getting into a deadlock condition every once in a while when running my
app. When I see that it's deadlocked I "Break All" in the VS debugger and
take a look at what the current running threads are doing. I noticed that
one of my threads (the one I expect to be running at the time) is waiting in
a call to Invoke. Here is the stack trace:
I see that the Invoke method is waiting after a call to WaitOne. Can
someone explain to me what exactly it's waiting on?
Lets say the call was Invoke(new MethodInvoker(OnUpdateStarted));
It didn't start running OnUpdateStarted yet since I would see some logging
indicating that it started.
Any tips on how to figure out what it's waiting on?
Also, when I use BeginInvoke, I do not see the problem (at least not yet).
Thanks.
I'm getting into a deadlock condition every once in a while when running my
app. When I see that it's deadlocked I "Break All" in the VS debugger and
take a look at what the current running threads are doing. I noticed that
one of my threads (the one I expect to be running at the time) is waiting in
a call to Invoke. Here is the stack trace:
mscorlib.dll!System.Threading.WaitHandle.WaitOne(long timeout, bool exitContext) + 0x2e bytes
mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) + 0x23 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WaitForWaitHandle(System.Threading.WaitHandle waitHandle = {System.Threading.ManualResetEvent}) + 0xa1 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.MarshaledInvoke(System.Windows.Forms.Control caller, System.Delegate method, object[] args, bool synchronous) + 0x36d bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.Invoke(System.Delegate method, object[] args) + 0x48 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.Invoke(System.Delegate method) + 0x7 bytes
Test.dll!ReqForm.OnUpdateStarted() Line 1059 + 0x24 bytes C#
I see that the Invoke method is waiting after a call to WaitOne. Can
someone explain to me what exactly it's waiting on?
Lets say the call was Invoke(new MethodInvoker(OnUpdateStarted));
It didn't start running OnUpdateStarted yet since I would see some logging
indicating that it started.
Any tips on how to figure out what it's waiting on?
Also, when I use BeginInvoke, I do not see the problem (at least not yet).
Thanks.