<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.15">
  <compounddef id="_fiber_8_when_all_8cs" kind="file" language="C#">
    <compoundname>Fiber.WhenAll.cs</compoundname>
    <innerclass refid="class_spicy_pixel_1_1_threading_1_1_fiber" prot="public">SpicyPixel::Threading::Fiber</innerclass>
    <innernamespace refid="namespace_spicy_pixel">SpicyPixel</innernamespace>
    <innernamespace refid="namespace_spicy_pixel_1_1_threading">SpicyPixel::Threading</innernamespace>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="keyword">using</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>;</highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>.<ref refid="namespace_system_1_1_collections" kindref="compound">Collections</ref>;</highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>.<ref refid="namespace_system_1_1_threading" kindref="compound">Threading</ref>;</highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>.<ref refid="namespace_system_1_1_collections" kindref="compound">Collections</ref>.<ref refid="namespace_system_1_1_collections_1_1_generic" kindref="compound">Generic</ref>;</highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>.Linq;</highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>.<ref refid="namespace_system_1_1_threading" kindref="compound">Threading</ref>.<ref refid="namespace_system_1_1_threading_1_1_tasks" kindref="compound">Tasks</ref>;</highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespace_spicy_pixel_1_1_threading" kindref="compound">SpicyPixel.Threading</ref></highlight></codeline>
<codeline lineno="9"><highlight class="normal">{</highlight></codeline>
<codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">partial<sp/>class<sp/></highlight><highlight class="normal">Fiber</highlight></codeline>
<codeline lineno="11"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="21" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(params<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/>[]<sp/>fibers)</highlight></codeline>
<codeline lineno="22"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(fibers,<sp/>Timeout.Infinite,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref>.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1aa93a5902f076f45412f5e8fbfece237a" kindref="member">None</ref>);</highlight></codeline>
<codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
<codeline lineno="36" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a7763f6cd27bcd32be7f71649478e95fc" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a7763f6cd27bcd32be7f71649478e95fc" kindref="member">WhenAll</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/>[]<sp/>fibers,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken)</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(fibers,<sp/>Timeout.Infinite,<sp/>cancellationToken);</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="51" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a0f426a21477ab26b45b8de3fbbe8b35b" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a0f426a21477ab26b45b8de3fbbe8b35b" kindref="member">WhenAll</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/>[]<sp/>fibers,<sp/>TimeSpan<sp/>timeout)</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(fibers,<sp/>CheckTimeout<sp/>(timeout),<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref>.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1aa93a5902f076f45412f5e8fbfece237a" kindref="member">None</ref>);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="66" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a1583e519fa2815f11288ab43de76d701" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a1583e519fa2815f11288ab43de76d701" kindref="member">WhenAll</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/>[]<sp/>fibers,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout)</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(fibers,<sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref>.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1aa93a5902f076f45412f5e8fbfece237a" kindref="member">None</ref>);</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="82" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a6cf15a2a981524f0d59ff84a1d776031" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a6cf15a2a981524f0d59ff84a1d776031" kindref="member">WhenAll</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/>[]<sp/>fibers,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken)</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(fibers,<sp/>millisecondsTimeout,<sp/>cancellationToken,<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler" kindref="compound">FiberScheduler</ref>.<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler_1ab85bfa23595a91e11fe78d780bb548fb" kindref="member">Current</ref>);</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight></codeline>
<codeline lineno="99" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a13f9b88e8f221f9d28399704e1c6f21e" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a13f9b88e8f221f9d28399704e1c6f21e" kindref="member">WhenAll</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/>[]<sp/>fibers,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken,<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler" kindref="compound">FiberScheduler</ref><sp/>scheduler)</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fibers<sp/>==<sp/></highlight><highlight class="keyword">null</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>ArgumentNullException<sp/>(</highlight><highlight class="stringliteral">&quot;fibers&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="103"><highlight class="normal"></highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">foreach</highlight><highlight class="normal"><sp/>(var<sp/>fiber<sp/></highlight><highlight class="keywordflow">in</highlight><highlight class="normal"><sp/>fibers)<sp/>{</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fiber<sp/>==<sp/></highlight><highlight class="keyword">null</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>ArgumentException<sp/>(</highlight><highlight class="stringliteral">&quot;fibers&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;the<sp/>fibers<sp/>argument<sp/>contains<sp/>a<sp/>null<sp/>element&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="108"><highlight class="normal"></highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>.<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a2fac263d7ca567ffd0b4b5a9c4b87c89" kindref="member">Factory</ref>.<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_factory_1a2e0170321f95f5dae367648a3134ed90" kindref="member">StartNew</ref><sp/>(WhenAllFibersCoroutine<sp/>(fibers,<sp/>millisecondsTimeout,<sp/>cancellationToken),<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="111"><highlight class="normal"></highlight></codeline>
<codeline lineno="124" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1aa5eced30029b7e4663c5d2e4eff1acf3" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1aa5eced30029b7e4663c5d2e4eff1acf3" kindref="member">WhenAll</ref><sp/>(IEnumerable&lt;Fiber&gt;<sp/>fibers,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken,<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler" kindref="compound">FiberScheduler</ref><sp/>scheduler)</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(fibers.ToArray<sp/>(),<sp/>millisecondsTimeout,<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="128"><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>IEnumerator<sp/>WhenAllFibersCoroutine<sp/>(IEnumerable&lt;Fiber&gt;<sp/>fibers,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken)</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>var<sp/>startWait<sp/>=<sp/>DateTime.Now;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">true</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((millisecondsTimeout<sp/>!=<sp/>Timeout.Infinite<sp/></highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;&amp;<sp/>(DateTime.Now<sp/>-<sp/>startWait).TotalMilliseconds<sp/>&gt;=<sp/>millisecondsTimeout))<sp/>{</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>TimeoutException<sp/>();</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="137"><highlight class="normal"></highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cancellationToken.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1ab98969cae74910bdbdde565b167c5499" kindref="member">ThrowIfCancellationRequested</ref><sp/>();</highlight></codeline>
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fibers.All<sp/>(f<sp/>=&gt;<sp/>f.IsCompleted))<sp/>{</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fibers.Any<sp/>(f<sp/>=&gt;<sp/>f.IsCanceled))<sp/>{</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>.<ref refid="namespace_system_1_1_threading" kindref="compound">Threading</ref>.<ref refid="class_system_1_1_threading_1_1_operation_canceled_exception" kindref="compound">OperationCanceledException</ref><sp/>();</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fibers.Any<sp/>(f<sp/>=&gt;<sp/>f.IsFaulted))<sp/>{</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="class_system_1_1_aggregate_exception" kindref="compound">AggregateException</ref><sp/>(</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fibers.Where<sp/>(f<sp/>=&gt;<sp/>f.IsFaulted).Select<sp/>(f<sp/>=&gt;<sp/>f.Exception));</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>yield<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>yield<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FiberInstruction.YieldToAnyFiber;</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="154"><highlight class="normal"></highlight></codeline>
<codeline lineno="164" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a67900aba5e7d97040c388111cf0429e8" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a67900aba5e7d97040c388111cf0429e8" kindref="member">WhenAll</ref><sp/>(params<sp/><ref refid="class_system_1_1_threading_1_1_tasks_1_1_task" kindref="compound">Task</ref><sp/>[]<sp/>tasks)</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(tasks,<sp/>Timeout.Infinite,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref>.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1aa93a5902f076f45412f5e8fbfece237a" kindref="member">None</ref>);</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="168"><highlight class="normal"></highlight></codeline>
<codeline lineno="179" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ad3c7ca7e89bc6466be8d8cdf1a1781e5" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ad3c7ca7e89bc6466be8d8cdf1a1781e5" kindref="member">WhenAll</ref><sp/>(<ref refid="class_system_1_1_threading_1_1_tasks_1_1_task" kindref="compound">Task</ref><sp/>[]<sp/>tasks,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken)</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(tasks,<sp/>Timeout.Infinite,<sp/>cancellationToken);</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="183"><highlight class="normal"></highlight></codeline>
<codeline lineno="194" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a72bc77c7751752e2ae58adc9a1e039ee" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a72bc77c7751752e2ae58adc9a1e039ee" kindref="member">WhenAll</ref><sp/>(<ref refid="class_system_1_1_threading_1_1_tasks_1_1_task" kindref="compound">Task</ref><sp/>[]<sp/>tasks,<sp/>TimeSpan<sp/>timeout)</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(tasks,<sp/>CheckTimeout<sp/>(timeout),<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref>.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1aa93a5902f076f45412f5e8fbfece237a" kindref="member">None</ref>);</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="198"><highlight class="normal"></highlight></codeline>
<codeline lineno="209" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a8b0b3090677e0f7b982643994468131a" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a8b0b3090677e0f7b982643994468131a" kindref="member">WhenAll</ref><sp/>(<ref refid="class_system_1_1_threading_1_1_tasks_1_1_task" kindref="compound">Task</ref><sp/>[]<sp/>tasks,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout)</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(tasks,<sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref>.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1aa93a5902f076f45412f5e8fbfece237a" kindref="member">None</ref>);</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="213"><highlight class="normal"></highlight></codeline>
<codeline lineno="225" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ad705f2159d3c583777ca2a5e49d79ecc" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ad705f2159d3c583777ca2a5e49d79ecc" kindref="member">WhenAll</ref><sp/>(<ref refid="class_system_1_1_threading_1_1_tasks_1_1_task" kindref="compound">Task</ref><sp/>[]<sp/>tasks,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken)</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(tasks,<sp/>millisecondsTimeout,<sp/>cancellationToken,<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler" kindref="compound">FiberScheduler</ref>.<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler_1ab85bfa23595a91e11fe78d780bb548fb" kindref="member">Current</ref>);</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="229"><highlight class="normal"></highlight></codeline>
<codeline lineno="242" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ab825c0663bf2cd77d113c11e62582bf0" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ab825c0663bf2cd77d113c11e62582bf0" kindref="member">WhenAll</ref><sp/>(<ref refid="class_system_1_1_threading_1_1_tasks_1_1_task" kindref="compound">Task</ref><sp/>[]<sp/>tasks,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken,<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler" kindref="compound">FiberScheduler</ref><sp/>scheduler)</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tasks<sp/>==<sp/></highlight><highlight class="keyword">null</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>ArgumentNullException<sp/>(</highlight><highlight class="stringliteral">&quot;tasks&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="246"><highlight class="normal"></highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">foreach</highlight><highlight class="normal"><sp/>(var<sp/>fiber<sp/></highlight><highlight class="keywordflow">in</highlight><highlight class="normal"><sp/>tasks)<sp/>{</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fiber<sp/>==<sp/></highlight><highlight class="keyword">null</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>ArgumentException<sp/>(</highlight><highlight class="stringliteral">&quot;tasks&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;the<sp/>tasks<sp/>argument<sp/>contains<sp/>a<sp/>null<sp/>element&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="251"><highlight class="normal"></highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>.<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a2fac263d7ca567ffd0b4b5a9c4b87c89" kindref="member">Factory</ref>.<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_factory_1a2e0170321f95f5dae367648a3134ed90" kindref="member">StartNew</ref><sp/>(WhenAllTasksCoroutine<sp/>(tasks,<sp/>millisecondsTimeout,<sp/>cancellationToken),<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="254"><highlight class="normal"></highlight></codeline>
<codeline lineno="267" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ada090af4846b6839ad0445d6624ebd7c" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ada090af4846b6839ad0445d6624ebd7c" kindref="member">WhenAll</ref><sp/>(IEnumerable&lt;Task&gt;<sp/>tasks,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken,<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_scheduler" kindref="compound">FiberScheduler</ref><sp/>scheduler)</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a9ba44dbc008fc947bc4c1a169c601391" kindref="member">WhenAll</ref><sp/>(tasks.ToArray<sp/>(),<sp/>millisecondsTimeout,<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="271"><highlight class="normal"></highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>IEnumerator<sp/>WhenAllTasksCoroutine<sp/>(IEnumerable&lt;Task&gt;<sp/>tasks,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken)</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>var<sp/>startWait<sp/>=<sp/>DateTime.Now;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">true</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((millisecondsTimeout<sp/>!=<sp/>Timeout.Infinite</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;&amp;<sp/>(DateTime.Now<sp/>-<sp/>startWait).TotalMilliseconds<sp/>&gt;=<sp/>millisecondsTimeout))<sp/>{</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>TimeoutException<sp/>();</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="280"><highlight class="normal"></highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cancellationToken.<ref refid="struct_system_1_1_threading_1_1_cancellation_token_1ab98969cae74910bdbdde565b167c5499" kindref="member">ThrowIfCancellationRequested</ref><sp/>();</highlight></codeline>
<codeline lineno="282"><highlight class="normal"></highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tasks.All<sp/>(t<sp/>=&gt;<sp/>t.IsCompleted))<sp/>{</highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tasks.Any<sp/>(t<sp/>=&gt;<sp/>t.IsCanceled))<sp/>{</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespace_system" kindref="compound">System</ref>.<ref refid="namespace_system_1_1_threading" kindref="compound">Threading</ref>.<ref refid="class_system_1_1_threading_1_1_operation_canceled_exception" kindref="compound">OperationCanceledException</ref><sp/>();</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tasks.Any<sp/>(t<sp/>=&gt;<sp/>t.IsFaulted))<sp/>{</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="class_system_1_1_aggregate_exception" kindref="compound">AggregateException</ref><sp/>(</highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tasks.Where<sp/>(t<sp/>=&gt;<sp/>t.IsFaulted).SelectMany<sp/>(t<sp/>=&gt;<sp/>t.Exception.InnerExceptions));</highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>yield<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="293"><highlight class="normal"></highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>yield<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FiberInstruction.YieldToAnyFiber;</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="298"><highlight class="normal">}</highlight></codeline>
<codeline lineno="299"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="Source/SpicyPixel.Threading/Fiber.WhenAll.cs"/>
  </compounddef>
</doxygen>
