CPallini answered you, but the polling of the thread for status is a sign of really wrong design.
In some situations, you need a blocking call
. The calling thread will be put in wait state, sleeping without wasting any CPU cycles, until awakened by completion. Please see:
I see you already trying "
if (working) thread.Join()
", but this is pointless, really. Explain what you are trying to achieve, the purpose of it.
In other cases, it's the best for a thread to notify other threads on completion. How? It depends. Please see my comments to Solution 2.