<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xin9le</author_name>
  <author_url>https://blog.hatena.ne.jp/xin9le/</author_url>
  <blog_title>xin9le.net</blog_title>
  <blog_url>https://xin9le.hatenablog.jp/</blog_url>
  <categories>
    <anon>TPL</anon>
  </categories>
  <description>アプリケーションによっては、呼び出し元スレッドでタスクが完了するのを待ち合わせなければならないケースがあります。また、実行していたタスクから結果を受け取り、それに応じて処理を分けたい場合もあります。言うまでもなく、TPLにはこのようなニーズに答えるための機能が準備されています。今回はそれらを見ていきます。 完了の待機 実行したタスクを待機する方法はとっても簡単で、次のサンプルのようにTaskインスタンスのWaitメソッドを呼び出すだけです。これによりタスクが終了するまで呼び出し元スレッドがブロックされるので、結果としてタスクの完了を待機することができます。以下の例では完了までずっと待機するよう…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxin9le.hatenablog.jp%2Fentry%2F2011%2F08%2F18%2F145810&quot; title=&quot;TPL入門 (9) - 完了の待機と結果の取得 - xin9le.net&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-08-18 14:58:10</published>
  <title>TPL入門 (9) - 完了の待機と結果の取得</title>
  <type>rich</type>
  <url>https://xin9le.hatenablog.jp/entry/2011/08/18/145810</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
