Thread abort in thread safe mehod calls
I am trying to call a window(message box custom window) inside a thread. I
saw some examples like
// This event handler creates a thread that calls a
// Windows Forms control in a thread-safe way.
private void setTextSafeBtn_Click(
object sender,
EventArgs
e)
{
this.demoThread =
new Thread(new ThreadStart(this.ThreadProcSafe));
this.demoThread.Start();
}
// This method is executed on the worker thread and makes
// a thread-safe call on the TextBox control.
private void ThreadProcSafe()
{
this.SetText("This text was set safely.");
}
I have a doubt on this, these threads are not aborted anywhere. will this
cause an issue? I am asking since I saw my application running in
background even if the application exited.
No comments:
Post a Comment