Mike said:
How can I make an event handler in main thread which would be called
after another thread terminate?
You can't ever cause some method to be executed asynchronous within a
specific other thread, without instrumenting the target thread to do so.
So your main thread would need to watch for this to happen on occasion,
and execute your event handler when it does. You'd need to arrange for
that polling to occur on a regular basis. It could do this polling
using the isAlive() method of its target thread.
This all raises the question of why it's so important for you to have
the event handler called *in the main thread*. It would be far easier
to provide for such a notification run in another thread (depending on
your exact requirements, either the target thread that's about to
terminate, or a third watchdog thread).
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation