title: SDL and C++: Waiting for multiple threads to finish
body: <p>I am having trouble to fix the following problem:
  I have 10 threads that don't need to interact with each other and therefore can all run simultaneusly.
  I create them in a loop.
  However I need to wait until all threads are done until I can continue with the code that starts after the for loop.
  Here is the problem in pseudo code:</p>
  
  <pre><code>//start threads
  for (until 10) {
      SDL_Thread* thread = SDL_CreateThread();
  }
  //the rest of the code starts here, all threads need to be done first
  </code></pre>
  
  <p>What's the best way to get this done?</p>
  
  <p>I need to stay platform independent with that problem, that's why I try to only use SDL-functions.</p>
  
  <p>If there is another platform independent solution for c++, I am fine with that too.</p>