title: Foreach thread.join, does not work as expected, how to fix?
body: <p>I want to run some method in few threads, this method take some argument.
  When I try to execute this, my test not passed on it, because some thread not working to end. But, at the end of function I use <code>Foreach { thread.join }</code>
  Here is my code: (Paths - List of some objects. Parse - method with obj from Paths.)</p>
  
  <pre class="lang-cs prettyprint-override"><code>public void RunAsync()
  {
      Thread[] threadArr = new Thread[Paths.Count];
      var pathsArr = Paths.ToArray();
  
      for (int i = 0; i &lt; PathsArr.Length; i++)
      {
          threadArr[i] = new Thread(new ParameterizedThreadStart(Parse));
          threadArr[i].Start((PathsArr[i]));
      }
  
      foreach (var thread in threadArr)
      {
          thread.Join();
      }
  }
  </code></pre>
  
  <p>How can I fix it or which construction/techniques need to use in that case?
  I want to do this in few thread because to do this synchronously is too much long.</p>