when does a method return if a new thread is started inside it
<p>Suppose I have some code that looks like this:</p>

<pre><code>public SomeMethod() {

   foreach (x...)
   {
     if (SomeCondition)
     {
        var SomeVariable = x;
        Task.Factory.StartNew(() =&gt; SomeOtherMethod(SomeVariable));
     }
   }

   return SomeValue;
}
</code></pre>

<p>If <code>SomeOtherMethod</code> is called and started in a new thread, does a) <code>SomeMethod</code> wait until that thread is finished running before returning or b) the method return and then the threads of <code>SomeOtherMethod</code> just continue on their own even after <code>SomeMethod</code> returned? </p>

<p>Reason I ask is that I need to wait until all <code>SomeOtherMethods</code> finish before exit SomeMethod.</p>

<p>Thanks.</p>
