Threads

  • Thread starter Thread starter Juan Carlos
  • Start date Start date
J

Juan Carlos

Hi

How can I associate an event to a thread??? I need to know
exactly when a thread finish.

Is it possible???

Regards
 
Hi Juan,

You can use asynchronous programming (BeginInvoke and EndInvoke) instead.
With these methods, you can supply a callback delegate which will be invoked
when the call is complete.

Or, you can write a thread procedure like this:

try
{
RunCore();
}
finally
{
OnCompleted();
}
 
Juan Carlos said:
How can I associate an event to a thread??? I need to know
exactly when a thread finish.

If you want to wait for the thread to finish, Thread.Join is a nice easy way
(as long as you already know the thread is exiting).
 
Back
Top