title: Nested async method blocks without await
body: <p>I'm not sure about what's going on here. As I understand, as soon as a method encounters the await keyword, it effectively returns, and later continues executing once the <code>Task</code> is completed. However, that is not the behavior that I am observing. I have two simple methods:</p>
  
  <pre><code>public static async Task&lt;bool&gt; Level1()
  {            
      var t = await Level2();      
      Console.WriteLine("L1 done.");  
      return t;                     
  }
  
  public static async Task&lt;bool&gt; Level2()
  {
      int delay = 10;
      Thread.Sleep(100);
      var t = new TaskFactory();
  
      t.StartNew(() =&gt; { Thread.Sleep(delay); });
      Console.WriteLine("L2 done.");
      return true;
  }
  </code></pre>
  
  <p>And in main, I call</p>
  
  <pre><code>static void Main(string[] args)
  {
      Level1();
      Console.WriteLine("Main done.");
  }
  </code></pre>
  
  <p>Now, I would expect <code>Main()</code> to continue executing after the call to <code>Level1()</code>, since it is not awaited, and because <code>Level1()</code> contains an await keyword. The resulting output, however, is</p>
  
  <pre><code>L2 done.
  L1 done.
  Main done.
  </code></pre>
  
  <p>Indicating that my async methods are running synchronously. Modifying <code>Level2()</code> to use the await keyword solves the problem, and the <code>Level1()</code> call no longer blocks. Why do I need to use "await" in the nested method <code>Level2()</code> method to keep <code>Level1()</code> from blocking Main?</p>