I would like an elegant way to capture the end / exit event of a stream. So far I have found two approaches:
- Use a background worker that has a RunWorkerCompleted event, or
- My workflow will explicitly call the delegate "I am leaving."
Yes, they will work, but there must be some way from the parent thread (the thread that calls the Thread.Start () method) in order to detect when the thread exited regardless of why, how, and when. For example, the Visual Studio debug output window tells you when threads are ending:, "Thread 0x1454 exited with code 0 (0x0)." Therefore, it should be possible.
Thanks in advance for any ideas!
source
share