I'm creating a thread class to encapsulat the windows thread methods. I'm trying to create a method that makes the application wait for the thread to complete before it exits the application. If I use a while loop and boolean flag, it works but obviously it spikes my CPU use and its just not ideal.
What ways would you use to wait for the completion of a thread? (i'm not really looking for code here, just areas to look into)