I want to create 2 threads. The first threads continues running until the second thread finishes and then the first one dies.
What I have planned on doing is: (in pseudo-code)
-set default exit code
-spawn thread 1
-spawn thread 2
-get exit code from thread 2
-if exit code is from thread 2
- destroy thread 1
I'm not exactly sure how to approach this since I cannot seem to find on any tutorials how to manually kill a thread.
Can someone help me?
Edited by Arunbear: Changed title from 'Threads', as per Monastery guidelines