Does MainComponent wait for ThreadWithProgressWindow to finish or cancel?

SUMMARY OF QUESTION:

I’m not 100% clear on whether instantiating multiple ThreadWithProgressWindow classes constitutes unique threads running in parallel or whether MainComponent waits for the first instantiation to either finish or cancel before moving on to the second instantiation.

DETAILS:

I have created two classes that inherit from ThreadWithProgressWindow. In MainComponent.cpp, I have a button that, when clicked, starts the first process running (instantiating an object of the first class) and then starts the second process running (instantiating an object of the second class) on the very next line of code.

To be safe, I created a (bool) mainThreadIsAvailable flag that gets set to false when either of the threads start and gets set to true when the thread in question finishes normally or is canceled. I then use a while loop to prevent the second process from starting until I know the first has completed or been canceled by the user.

I’m just wondering if I need to do this or not. My program seems to work fine either way, but as the processes grow larger, I want to make sure #1 finishes prior to #2 beginning, and yet I don’t want to bother with flags and while loops if JUCE is already waiting for an exit code before moving on.

I looked at the class documentation and I wasn’t able to deduce with certainty which is the case. Can anyone confirm this for me one way or the other?

Much appreciated.

-David