title: C# Thread Queue Synchronize
body: <p>Greetings, I am trying to play some audio files without holding up the GUI. Below is a sample of the code:</p>
  
  <pre><code>if (audio)
  {
      if (ThreadPool.QueueUserWorkItem(new WaitCallback(CoordinateProc), fireResult))
      {
  
      }
      else
      {
          MessageBox.Show("false");
      }
  }
  
  if (audio)
  {
      if (ThreadPool.QueueUserWorkItem(new WaitCallback(FireProc), fireResult))
      {
  
      }
      else
      {
           MessageBox.Show("false");
      }
  }
  
  if (audio)
  {
      if (ThreadPool.QueueUserWorkItem(new WaitCallback(HitProc), fireResult))
      {
  
      }
      else
      {
          MessageBox.Show("false");
      }
  }
  </code></pre>
  
  <p>The situation is the samples are not being played in order. some play before the other and I need to fix this so the samples are played one after another in order.</p>
  
  <p>How do I implement this please?</p>
  
  <p>Thank you.</p>
  
  <p>EDIT: <code>ThreadPool.QueueUserWorkItem(new WaitCallback(FireAttackProc), fireResult);</code></p>
  
  <p>I have placed all my sound clips in FireAttackProc. What this does not do and I want is: wait until the thread stops running before starting a new thread so the samples dont overlap.</p>