title: foreach loop with Task
body: <p>I need to make an foreach loop with 3 tasks, this needs to wait till all 3 tasks are finish and than move to next one.
  Something like</p>
  
  <pre><code>foreach (class r in sets)
  {
      Task.Factory.StartNew(() =&gt; {
        DoThisFunction1();
      }, TaskCreationOptions.LongRunning);
      Task.Factory.StartNew(() =&gt; {
       DoThisFunction2();
      }, TaskCreationOptions.LongRunning);
      Task.Factory.StartNew(() =&gt; {
       DoThisFunction3();
      }, TaskCreationOptions.LongRunning);
   }
  </code></pre>
  
  <p>somebody can give a simple way how to do this?</p>