Atmapuri said:
How can I have a thread notify the main thread that it has ended?
The thread object seems to have only one event, ThreadStart.
I think that this is not correctly expressed. What you mean is "notify
the main program" instead of "notify the main thread". Just write a method
in your main program called "ThreadEnded" and call ThreadEnded() from the
code executing your separate thread. This method will, of course, execute in
the calling thread, not in the main thread. If the program is a WinForm and
you need to marshall execution to the main thread in order to update the
user interface, you can use the Invoke method of any Control (including the
Form) to enqueue a call to a method that will execute in the Control's
thread.