It looks like you aren&#39;t keeping your app alive to allow the secondary queue to reliably execute the closures you queue with it. It isn&#39;t really clear what you want to attempt so it hard to suggest the correct way to do things.<br><br>-Shawn<br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 5, 2017 at 11:39 PM Mr Bee via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px" class="gmail_msg"><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404" class="gmail_msg"><span class="gmail_msg">Hi all,</span></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404" class="gmail_msg"><span class="gmail_msg"><br class="gmail_msg"></span></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404" dir="ltr" class="gmail_msg"><span id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3274" class="gmail_msg">I&#39;m currently still learning Swift 3. Now I&#39;m playing around with GCD (grand central dispatch). I&#39;d like to start an external process using Process from an asynced thread, and create another thread to stop that external process after some times. Here&#39;s what I do</span>…</div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404" dir="ltr" class="gmail_msg"><span class="gmail_msg"><br class="gmail_msg"></span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3921" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3922" class="gmail_msg">import</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3923" class="gmail_msg"> Foundation</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3924" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3925" class="gmail_msg">import</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3926" class="gmail_msg"> Dispatch</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3927" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3928" class="gmail_msg"></span><br id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3929" class="gmail_msg"></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(53,86,138)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3930" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3931" class="gmail_msg">extension</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3932" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3933" class="gmail_msg">Process</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3934" class="gmail_msg"> {</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3935" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3936" class="gmail_msg">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3937" class="gmail_msg">func</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3938" class="gmail_msg"> execute(command: </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3939" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3940" class="gmail_msg">, currentDir: </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3941" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3942" class="gmail_msg"> = </span><span style="font-variant-ligatures:no-common-ligatures;color:#e82300" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3943" class="gmail_msg">&quot;~&quot;</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3944" class="gmail_msg">, arguments: [</span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3945" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3946" class="gmail_msg">] = [], input: </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3947" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3948" class="gmail_msg"> = </span><span style="font-variant-ligatures:no-common-ligatures;color:#e82300" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3949" class="gmail_msg">&quot;&quot;</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3950" class="gmail_msg">) -&gt; </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3951" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3952" class="gmail_msg"> {</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3953" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3954" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3955" class="gmail_msg">if</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3956" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3957" class="gmail_msg">!</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3958" class="gmail_msg">input.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3959" class="gmail_msg">isEmpty</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3960" class="gmail_msg"> {</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3961" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3962" class="gmail_msg">      </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3963" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3964" class="gmail_msg"> pipeIn = </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3965" class="gmail_msg">Pipe</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3966" class="gmail_msg">()</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3967" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3968" class="gmail_msg">      </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3969" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3970" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3971" class="gmail_msg">standardInput</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3972" class="gmail_msg"> = pipeIn</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,119,66)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3973" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3974" class="gmail_msg">      </span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3975" class="gmail_msg"><i id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3976" class="gmail_msg">// multiple inputs are separated by newline</i></span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3977" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3978" class="gmail_msg">      </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3979" class="gmail_msg">if</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3980" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3981" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3982" class="gmail_msg"> input = input.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3983" class="gmail_msg">data</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3984" class="gmail_msg">(using: </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3985" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3986" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3987" class="gmail_msg">Encoding</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3988" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3989" class="gmail_msg">utf8</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3990" class="gmail_msg">) {</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3991" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3992" class="gmail_msg">        pipeIn.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3993" class="gmail_msg">fileHandleForWriting</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3994" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3995" class="gmail_msg">write</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3996" class="gmail_msg">(input)</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3997" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3998" class="gmail_msg">      }</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3999" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4000" class="gmail_msg">    }</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4001" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4002" class="gmail_msg">    </span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4003" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4004" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4005" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4006" class="gmail_msg"> pipeOut = </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4007" class="gmail_msg">Pipe</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4008" class="gmail_msg">()</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4009" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4010" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4011" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4012" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4013" class="gmail_msg">standardOutput</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4014" class="gmail_msg"> = pipeOut</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4015" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4016" class="gmail_msg">    </span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4017" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4018" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4019" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4020" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4021" class="gmail_msg">arguments</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4022" class="gmail_msg"> = arguments</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4023" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4024" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4025" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4026" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4027" class="gmail_msg">launchPath</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4028" class="gmail_msg"> = command</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4029" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4030" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4031" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4032" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4033" class="gmail_msg">currentDirectoryPath</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4034" class="gmail_msg"> = currentDir</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4035" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4036" class="gmail_msg">    </span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4037" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4038" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4039" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4040" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4041" class="gmail_msg">launch</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4042" class="gmail_msg">()</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4043" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4044" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4045" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4046" class="gmail_msg"> output = pipeOut.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4047" class="gmail_msg">fileHandleForReading</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4048" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4049" class="gmail_msg">readDataToEndOfFile</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4050" class="gmail_msg">()</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4051" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4052" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4053" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4054" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4055" class="gmail_msg">waitUntilExit</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4056" class="gmail_msg">()</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4057" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4058" class="gmail_msg">    </span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4059" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4060" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4061" class="gmail_msg">return</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4062" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4063" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4064" class="gmail_msg">(data: output, encoding: </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4065" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4066" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4067" class="gmail_msg">Encoding</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4068" class="gmail_msg">(rawValue: </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4069" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4070" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4071" class="gmail_msg">Encoding</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4072" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4073" class="gmail_msg">utf8</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4074" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4075" class="gmail_msg">rawValue</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4076" class="gmail_msg">))!</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4077" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4078" class="gmail_msg">  }</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4079" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4080" class="gmail_msg">}</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4081" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4082" class="gmail_msg"></span><br id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4083" class="gmail_msg"></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,119,66)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4084" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4085" class="gmail_msg"><i id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4086" class="gmail_msg">//print(Process().execute(command: &quot;/bin/ls&quot;, arguments: [&quot;-l&quot;]))</i></span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4087" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4088" class="gmail_msg"></span><br id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4089" class="gmail_msg"></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4090" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4091" class="gmail_msg">var</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4092" class="gmail_msg"> cmd = </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4093" class="gmail_msg">Process</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4094" class="gmail_msg">()</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4095" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4096" class="gmail_msg"></span><br id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4097" class="gmail_msg"></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4098" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4099" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4100" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4101" class="gmail_msg">&quot;Starting...&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4102" class="gmail_msg">)</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4103" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4104" class="gmail_msg"></span><br id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4105" class="gmail_msg"></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4106" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4107" class="gmail_msg">DispatchQueue</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4108" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4109" class="gmail_msg">global</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4110" class="gmail_msg">(qos: .</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4111" class="gmail_msg">default</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4112" class="gmail_msg">).</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4113" class="gmail_msg">async</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4114" class="gmail_msg"> {</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4115" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4116" class="gmail_msg">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4117" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4118" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4119" class="gmail_msg">&quot;Executing...&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4120" class="gmail_msg">)</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4121" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4122" class="gmail_msg">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4123" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4124" class="gmail_msg"> s = </span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4125" class="gmail_msg">cmd</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4126" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4127" class="gmail_msg">execute</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4128" class="gmail_msg">(command: </span><span style="font-variant-ligatures:no-common-ligatures;color:#e82300" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4129" class="gmail_msg">&quot;/bin/ls&quot;</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4130" class="gmail_msg">, arguments: [</span><span style="font-variant-ligatures:no-common-ligatures;color:#e82300" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4131" class="gmail_msg">&quot;-l&quot;</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4132" class="gmail_msg">])</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4133" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4134" class="gmail_msg">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4135" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4136" class="gmail_msg">(s)</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4137" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4138" class="gmail_msg">}</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4139" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4140" class="gmail_msg"></span><br id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4141" class="gmail_msg"></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4142" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4143" class="gmail_msg">DispatchQueue</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4144" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4145" class="gmail_msg">global</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4146" class="gmail_msg">(qos: .</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4147" class="gmail_msg">default</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4148" class="gmail_msg">).</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4149" class="gmail_msg">asyncAfter</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4150" class="gmail_msg">(deadline: </span><span style="font-variant-ligatures:no-common-ligatures;color:#c35900" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4151" class="gmail_msg">DispatchTime</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4152" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4153" class="gmail_msg">now</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4154" class="gmail_msg">() + .</span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4155" class="gmail_msg">seconds</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4156" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#0433ff" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4157" class="gmail_msg">5</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4158" class="gmail_msg">)) {</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4159" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4160" class="gmail_msg">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#35568a" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4161" class="gmail_msg">if</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4162" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4163" class="gmail_msg">cmd</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4164" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4165" class="gmail_msg">isRunning</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4166" class="gmail_msg"> {</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4167" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4168" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4169" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4170" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4171" class="gmail_msg">&quot;Terminating...&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4172" class="gmail_msg">)</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168)" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4173" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4174" class="gmail_msg">    </span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4175" class="gmail_msg">cmd</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4176" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4177" class="gmail_msg">terminate</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4178" class="gmail_msg">()</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4179" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4180" class="gmail_msg">  }</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4181" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4182" class="gmail_msg">}</span></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4183" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4184" class="gmail_msg"></span><br id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4185" class="gmail_msg"></div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3008" class="gmail_msg">















































</div><div style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0)" dir="ltr" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4186" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#587ea8" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4187" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4188" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4189" class="gmail_msg">&quot;Done.&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4190" class="gmail_msg">)</span></div><div class="gmail_msg"></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2403" class="gmail_msg"> </div><div class="m_6211223635688417170signature gmail_msg" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2288"><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" class="gmail_msg"><br class="gmail_msg"></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" dir="ltr" class="gmail_msg">The code doesn&#39;t work as expected. The <span style="font-family:Menlo;font-size:12px;font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4226" class="gmail_msg">execute(</span><span style="font-family:Menlo;font-size:12px;font-variant-ligatures:no-common-ligatures" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4238" class="gmail_msg">)</span> function itself works fine (uncomment the call in the middle of the code), but I don&#39;t know why it doesn&#39;t work if it&#39;s called from within <span style="color:rgb(195,89,0);font-family:Menlo;font-size:12px" id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4246" class="gmail_msg">DispatchQueue</span> closure. Even if I call a much more simple function —like a for loop— it doesn&#39;t work consistenly, sometimes the loop is completed, but other times it&#39;s not.</div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" dir="ltr" class="gmail_msg">Google didn&#39;t really help me because this topic is pretty rare I suppose. Could anyone enlight me, how to make the code works as I expected? What did I do wrong?</div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" dir="ltr" class="gmail_msg">Thank you.</div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" dir="ltr" class="gmail_msg">Regards,</div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" class="gmail_msg"><br class="gmail_msg"></div><div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328" class="gmail_msg"><br class="gmail_msg"></div>–Mr Bee<div id="m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4403" class="gmail_msg"><br class="gmail_msg"></div></div></div></div>_______________________________________________<br class="gmail_msg">
swift-users mailing list<br class="gmail_msg">
<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="gmail_msg">
</blockquote></div>