title: Async CTP - Task timeout question
body: <p>I'm reading through the <a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=1&amp;sqi=2&amp;ved=0CBgQxQEwAA&amp;url=http%3A%2F%2Fdocs.google.com%2Fviewer%3Fa%3Dv%26q%3Dcache%3AdCfsoNxMrW0J%3Adownload.microsoft.com%2Fdownload%2F5%2FB%2F9%2F5B924336-AA5D-4903-95A0-56C6336E32C9%2FTAP.docx%2Btask-based%2Basynchronous%2Bpattern%2Bfiletype%3Adocx%26hl%3Den%26pid%3Dbl%26srcid%3DADGEESi2y3ALhsTyjdkQoz539RqpOlNUuBPp1525bqN0H31imbaykqPCck49ej_NwriAmZiLDqAdjCBW5gr-OWSRxTjrbpwkfPhjUGzMEhrd7CpNet9nRJzdt9pJSAq2GYNZudHQgDPj%26sig%3DAHIEtbSC1XxD8GP6BaY19akKeIj6NNNQZA&amp;ei=dyp1TemsBsqr8Ab_1fGfDA&amp;usg=AFQjCNFtsXgAg6N8Ydy0rl7KQbCihF2Vyw&amp;sig2=mgdGuDa1STdA5vFgU0EtAw" rel="nofollow" title="TAP Whitepaper">TAP Whitepaper</a>, and am confused by this sample given for implementing a timeout on page 22:</p>
  
  <p><em>"Consider a UI application which wants to download an image and disable the UI while the image is downloading.  If the download takes too long, however, the UI should be re-enabled and the download should be discarded."</em></p>
  
  <pre><code>public async void btnDownload_Click(object sender, EventArgs e)
  {
      btnDownload.Enabled = false;
      try
      {
          Task&lt;Bitmap&gt; download = GetBitmapAsync(url);
          if (download == await Task.WhenAny(download, Task.Delay(3000)))
          {
              Bitmap bmp = await download.TimeoutAfter(3000);
              pictureBox.Image = bmp;
              status.Text = “Downloaded”;
          }
          else
          {
              pictureBox.Image = null;
              status.Text = “Timed out”;
              download.ContinueWith(t =&gt; Trace(“Task finally completed”));
          }
      }
      finally { btnDownload.Enabled = true; }
  }
  </code></pre>
  
  <p>What confuses me is this line:</p>
  
  <pre><code>Bitmap bmp = await download.TimeoutAfter(3000);
  </code></pre>
  
  <p>What is the point of the TimeoutAfter at this point in the logic? Shouldn't this have already been accomplished via the call to Task.WhenAny? It seems like what it is saying is, "After the download task has finished, give it 3 more seconds to finish." Is this an error in the example or am I misunderstanding it?</p>