I have a code design as follows. The GUI thread makes three ThreadPool.QueueUserWorkItem calls. The third call waits for the first 2 calls to finish using AutoResetEvents. However, when one of the two threads throw an exception, I want the third thread to end and the control to return to the GUI thread. Any ideas on how I can go about doing this?
I have a code design as follows. The GUI thread makes three ThreadPool.QueueUserWorkItem calls.
Share
What’s wrong with setting the events not only when the threads finish but also when they throw an exception?