How to get Thread exit notification

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am starting a new threading to do some process. I want to get notified
when the thread does it's job and exits. After receiving the notification, I
want to refresh the form.

I am starting the thread like this:
<code>
System.Threading.ThreadStart tDelegate = new
System.Threading.ThreadStart(this.InitBasicServicesInfo);
this.m_threadProgress = new System.Threading.Thread(tDelegate);
this.m_threadProgress.IsBackground = true;
this.m_threadProgress.Name = "<InitBasicServicesInfo>";
this.m_threadProgress.Start();

</code>

Is there any event/notification message for this requirement.

Thanks
 
cnu said:
I am starting a new threading to do some process. I want to get notified
when the thread does it's job and exits. After receiving the notification, I
want to refresh the form.

I am starting the thread like this:
<code>
System.Threading.ThreadStart tDelegate = new
System.Threading.ThreadStart(this.InitBasicServicesInfo);
this.m_threadProgress = new System.Threading.Thread(tDelegate);
this.m_threadProgress.IsBackground = true;
this.m_threadProgress.Name = "<InitBasicServicesInfo>";
this.m_threadProgress.Start();

</code>

Is there any event/notification message for this requirement.

The easiest thing would be to make the new thread call back to the form
to say it had finished "on its way out". If you want to do this in a
few places, you could create your own wrapper which takes a
ThreadStart, and when it's asked to run, it runs the delegate and then
calls back.
 
Jon,
Is there an example of what you are describing or more detailed description
of handling threads somewhere?

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top