<?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_any_8cs" kind="file" language="C#">
    <compoundname>Fiber.WhenAny.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>.Linq;</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>.<ref refid="namespace_system_1_1_collections" kindref="compound">Collections</ref>;</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="20" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a056d8f867c323c59eabe49731c6e4a6d" 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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</ref><sp/>(params<sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>[]<sp/>fibers)</highlight></codeline>
<codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="22"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</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="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="34" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a0290ce91c9a9d9e2394f9575538eed98" 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_1a0290ce91c9a9d9e2394f9575538eed98" kindref="member">WhenAny</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>[]<sp/>fibers,<sp/><ref refid="struct_system_1_1_threading_1_1_cancellation_token" kindref="compound">CancellationToken</ref><sp/>cancellationToken)</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="36"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</ref><sp/>(fibers,<sp/>Timeout.Infinite,<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"></highlight></codeline>
<codeline lineno="48" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ac25236e71930f1e1c7f1ff2cd0fd2f01" 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_1ac25236e71930f1e1c7f1ff2cd0fd2f01" kindref="member">WhenAny</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>[]<sp/>fibers,<sp/>TimeSpan<sp/>timeout)</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="50"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</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="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight></codeline>
<codeline lineno="62" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a5d27712307286163b71aabefdd42c84a" 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_1a5d27712307286163b71aabefdd42c84a" kindref="member">WhenAny</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>[]<sp/>fibers,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>millisecondsTimeout)</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="64"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</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="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="66"><highlight class="normal"></highlight></codeline>
<codeline lineno="77" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a4a4a3c56c74cdcf2537f7f7397259f91" 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_1a4a4a3c56c74cdcf2537f7f7397259f91" kindref="member">WhenAny</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>[]<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="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="79"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</ref>(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="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="81"><highlight class="normal"></highlight></codeline>
<codeline lineno="93" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a64406594ead0e1c9871440707ad782c0" 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_1a64406594ead0e1c9871440707ad782c0" kindref="member">WhenAny</ref><sp/>(<ref refid="class_spicy_pixel_1_1_threading_1_1_fiber" kindref="compound">Fiber</ref>[]<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="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="95"><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="96"><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="97"><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><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="99"><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="100"><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">);<sp/><sp/><sp/><sp/><sp/><sp/><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></codeline>
<codeline lineno="102"><highlight class="normal"></highlight></codeline>
<codeline lineno="103"><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>(WhenAnyFibersCoroutine(fibers,<sp/>millisecondsTimeout,<sp/>cancellationToken),<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="117" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ad01ab12a1af6cdd5d1fbf3619c15ddff" 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_1ad01ab12a1af6cdd5d1fbf3619c15ddff" kindref="member">WhenAny</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="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="119"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</ref>(fibers.ToArray(),<sp/>millisecondsTimeout,<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="121"><highlight class="normal"></highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>IEnumerator<sp/>WhenAnyFibersCoroutine(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="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="124"><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="125"><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="126"><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="127"><highlight class="normal"><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="128"><highlight class="normal"><sp/><sp/><sp/><sp/><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_1a1b0338d63f9b268339e7348629301748" kindref="member">IsCancellationRequested</ref>)<sp/>{</highlight></codeline>
<codeline lineno="129"><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">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_result" kindref="compound">FiberResult</ref>(</highlight><highlight class="keyword">null</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="131"><highlight class="normal"></highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>var<sp/>fiber<sp/>=<sp/>fibers.FirstOrDefault(f<sp/>=&gt;<sp/>f.IsCompleted);</highlight></codeline>
<codeline lineno="133"><highlight class="normal"></highlight></codeline>
<codeline lineno="134"><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">)<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/>yield<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>FiberResult(fiber);</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/>yield<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FiberInstruction.YieldToAnyFiber;</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="141"><highlight class="normal"></highlight></codeline>
<codeline lineno="150" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1aa73901ab8377cd7f2deb7ac4261df9d8" 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_1aa73901ab8377cd7f2deb7ac4261df9d8" kindref="member">WhenAny</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="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="152"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</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="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_1a23db03152e91525999e8b3260d9d04df" 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_1a23db03152e91525999e8b3260d9d04df" kindref="member">WhenAny</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="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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</ref><sp/>(tasks,<sp/>Timeout.Infinite,<sp/>cancellationToken);</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="178" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1ad8c71c0af2cb2bf8e3b69e560f3cb899" 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_1ad8c71c0af2cb2bf8e3b69e560f3cb899" kindref="member">WhenAny</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="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="180"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</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="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="182"><highlight class="normal"></highlight></codeline>
<codeline lineno="192" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a35e33ed30bb26b25119b9576fe649d5a" 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_1a35e33ed30bb26b25119b9576fe649d5a" kindref="member">WhenAny</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="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="194"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</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="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="196"><highlight class="normal"></highlight></codeline>
<codeline lineno="207" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a3ae3d8e699c1b98a14db50edf23ce02a" 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_1a3ae3d8e699c1b98a14db50edf23ce02a" kindref="member">WhenAny</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="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="209"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</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="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="211"><highlight class="normal"></highlight></codeline>
<codeline lineno="223" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1a0f58036884f6a0707ef10585914e50cc" 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_1a0f58036884f6a0707ef10585914e50cc" kindref="member">WhenAny</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="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="225"><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="226"><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="227"><highlight class="normal"></highlight></codeline>
<codeline lineno="228"><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="229"><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="230"><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="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="232"><highlight class="normal"></highlight></codeline>
<codeline lineno="233"><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/>(WhenAnyTasksCoroutine<sp/>(tasks,<sp/>millisecondsTimeout,<sp/>cancellationToken),<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="235"><highlight class="normal"></highlight></codeline>
<codeline lineno="247" refid="class_spicy_pixel_1_1_threading_1_1_fiber_1aa26ca067df44a26e5649274c243bd5ba" 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_1aa26ca067df44a26e5649274c243bd5ba" kindref="member">WhenAny</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="248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="249"><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_1a056d8f867c323c59eabe49731c6e4a6d" kindref="member">WhenAny</ref><sp/>(tasks.ToArray<sp/>(),<sp/>millisecondsTimeout,<sp/>cancellationToken,<sp/>scheduler);</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><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/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>IEnumerator<sp/>WhenAnyTasksCoroutine<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="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="254"><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="255"><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="256"><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="257"><highlight class="normal"><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="258"><highlight class="normal"><sp/><sp/><sp/><sp/><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_1a1b0338d63f9b268339e7348629301748" kindref="member">IsCancellationRequested</ref>)<sp/>{</highlight></codeline>
<codeline lineno="259"><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">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="class_spicy_pixel_1_1_threading_1_1_fiber_result" kindref="compound">FiberResult</ref><sp/>(</highlight><highlight class="keyword">null</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="261"><highlight class="normal"></highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>var<sp/>fiber<sp/>=<sp/>tasks.FirstOrDefault<sp/>(f<sp/>=&gt;<sp/>f.IsCompleted);</highlight></codeline>
<codeline lineno="263"><highlight class="normal"></highlight></codeline>
<codeline lineno="264"><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">)<sp/>{</highlight></codeline>
<codeline lineno="265"><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">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>FiberResult<sp/>(fiber);</highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="267"><highlight class="normal"></highlight></codeline>
<codeline lineno="268"><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="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="272"><highlight class="normal">}</highlight></codeline>
<codeline lineno="273"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="Source/SpicyPixel.Threading/Fiber.WhenAny.cs"/>
  </compounddef>
</doxygen>
