title: What happens if I don't await a task?
body: <p>Consider this example:</p>
  
  <pre><code>var task = DoSomething()
  bool ready = await DoSomethingElse();
  if (!ready) 
    return null;
  
  var value = await DoThirdThing(); // depends on DoSomethingElse
  return value + await task;
  </code></pre>
  
  <p><code>DoSomething</code> does some very important work that may take a while, thus we start it off first.<br>
  In the meantime we check whether we're ready with <code>DoSomethingElse</code> and exit early if not.<br>
  We call <code>DoThirdThing</code> <em>only</em> if we are <code>ready</code>, as the universe might otherwise explode. </p>
  
  <p>We cannot use <code>Task.WhenAll</code> as <code>DoThirdThing</code> depends on <code>DoSomethingElse</code> and we also don't want to wait for <code>DoSomething</code> because we want to call the other two methods concurrently if possible.</p>
  
  <p><strong>The question:</strong> What happens to <code>task</code> if we're not <code>ready</code> and exit early?</p>
  
  <p>Will any exceptions that it throws be re-thrown by a <code>SynchronizationContext</code>?<br>
  Are there problems if <code>task</code> completes normally, as nobody consumes its value?</p>
  
  <p><strong>Follow-up:</strong> Is there a neat way to make sure <code>task</code> is awaited? </p>
  
  <p>We could simply <code>await task</code> if we are not <code>ready</code>, however if there were 50 exit conditions this would be very tedious.<br>
  Could a <code>finally</code> block be used to <code>await task</code> and re-throw potential exceptions? If <code>task</code> completed normally it would be awaited again in the <code>finally</code> block, but that shouldn't cause any problems?</p>