I would like an elegant way to capture a thread end/exit event. I've found two approaches so far:
- Use background worker, which has a RunWorkerCompleted event, or,
- Have my thread worker explicitly call an "I'm Exiting" delegate.
Yes, these will work, but there must be some way from the parent thread (the thread that calls the Thread.Start() method) to detect when a thread has exited regardless of why, how or when. For example, the Visual Studio Debug Output window reports when threads exit :, "The thread 0x1454 has exited with code 0 (0x0)." So it must be possible.
Thanks in advance for any ideas!