title: Why doesn't calling Task<T>.Result deadlock?
body: <p>After reading <a href="http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html" rel="noreferrer">this</a> post a few months ago, I became paranoid of getting the <code>Result</code> of a <code>Task&lt;T&gt;</code> and incessantly wrapped all of my calls to it with a <code>ConfigureAwait(false)</code> or <code>Task.Run</code>. However, for some reason the following code completes successfully:</p>
  
  <pre><code>public static void Main(string[] args)
  {
      var arrays = DownloadMany();
  
      foreach (var array in arrays);
  }
  
  IEnumerable&lt;byte[]&gt; DownloadMany()
  {
      string[] links = { "http://google.com", "http://microsoft.com", "http://apple.com" };
  
      using (var client = new HttpClient())
      {
          foreach (var uri in links)
          {
              Debug.WriteLine("Still here!");
              yield return client.GetByteArrayAsync(uri).Result; // Why doesn't this deadlock?
          }
      }
  }
  </code></pre>
  
  <p>The code prints <code>Still here!</code> 3 times and then exits. Is this specific to <code>HttpClient</code> that it is safe to call <code>Result</code> on (as in the people who wrote it have peppered it with <code>ConfigureAwait(false)</code>)?</p>