G
Guest
Hi!
I have a serious problem with what appears to be a deadlock in .NET cf. It
occures when I invoke Invalidate on a control from a thread other than the
main thread when the main thread is busy (i.e. displaying a form).
I have a situation similiar to this:
public class MyForm : System.Windows.Forms.Form
{
// ...
private void MyThreadedMethod()
{
while(true)
{
myLabel.Text = "..."; // This hangs the application if the main
thread is busy.
System.Threading.Thread.Sleep(1000);
}
}
// ...
}
How can I avoid this?
Thanks in advance!
Nille
I have a serious problem with what appears to be a deadlock in .NET cf. It
occures when I invoke Invalidate on a control from a thread other than the
main thread when the main thread is busy (i.e. displaying a form).
I have a situation similiar to this:
public class MyForm : System.Windows.Forms.Form
{
// ...
private void MyThreadedMethod()
{
while(true)
{
myLabel.Text = "..."; // This hangs the application if the main
thread is busy.
System.Threading.Thread.Sleep(1000);
}
}
// ...
}
How can I avoid this?
Thanks in advance!
Nille