<html><head></head><body><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"><div id="yui_3_16_0_ym19_1_1483687514550_15211"><span>How to make my app alive to make the second queue finish its job? What I want is:</span></div><div id="yui_3_16_0_ym19_1_1483687514550_15211"><span><br></span></div><div id="yui_3_16_0_ym19_1_1483687514550_15211" dir="ltr"><span>- start program</span></div><div id="yui_3_16_0_ym19_1_1483687514550_15211" dir="ltr"><span>- start an external process from a thread (asynchronously)</span></div><div id="yui_3_16_0_ym19_1_1483687514550_15211" dir="ltr"><span id="yui_3_16_0_ym19_1_1483687514550_15358">- start another thread after 5 seconds to terminate the process from the other thread</span></div><div id="yui_3_16_0_ym19_1_1483687514550_15211" dir="ltr"><span>- end program</span></div><div id="yui_3_16_0_ym19_1_1483687514550_15211" dir="ltr"><span><br></span></div><div id="yui_3_16_0_ym19_1_1483687514550_15211" dir="ltr"><span id="yui_3_16_0_ym19_1_1483687514550_15418">That's all.</span></div><div></div><div id="yui_3_16_0_ym19_1_1483687514550_15297">&nbsp;</div><div class="signature" id="yui_3_16_0_ym19_1_1483687514550_15229"><div id="yui_3_16_0_ym19_1_1483687514550_15419"><br></div>–Mr Bee<div id="yui_3_16_0_ym19_1_1483687514550_15228"><br></div></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Pada Jumat, 6 Januari 2017 14:49, Shawn Erickson &lt;shawnce@gmail.com&gt; menulis:<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv5249362650"><div>It looks like you aren't keeping your app alive to allow the secondary queue to reliably execute the closures you queue with it. It isn't really clear what you want to attempt so it hard to suggest the correct way to do things.<br clear="none"><br clear="none">-Shawn<br clear="none"><div class="yiv5249362650gmail_quote"><div class="yiv5249362650yqt2527079598" id="yiv5249362650yqt98990"><div dir="ltr">On Thu, Jan 5, 2017 at 11:39 PM Mr Bee via swift-users &lt;<a rel="nofollow" shape="rect" ymailto="mailto:swift-users@swift.org" target="_blank" href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br clear="none"></div><blockquote class="yiv5249362650gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv5249362650gmail_msg"><div class="yiv5249362650gmail_msg" style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404"><span class="yiv5249362650gmail_msg">Hi all,</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404"><span class="yiv5249362650gmail_msg"><br clear="none" class="yiv5249362650gmail_msg"></span></div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3274">I'm currently still learning Swift 3. Now I'm playing around with GCD (grand central dispatch). I'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's what I do</span>…</div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2404"><span class="yiv5249362650gmail_msg"><br clear="none" class="yiv5249362650gmail_msg"></span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3921" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3922" style="color:#35568a;">import</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3923" style=""> Foundation</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3924" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3925" style="color:#35568a;">import</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3926" style=""> Dispatch</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3927" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3928" style=""></span><br clear="none" class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3929"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3930" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(53,86,138);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3931" style="">extension</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3932" style="color:#000000;"> </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3933" style="color:#c35900;">Process</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3934" style="color:#000000;"> {</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3935" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3936" style="">&nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3937" style="color:#35568a;">func</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3938" style=""> execute(command: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3939" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3940" style="">, currentDir: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3941" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3942" style=""> = </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3943" style="color:#e82300;">"~"</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3944" style="">, arguments: [</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3945" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3946" style="">] = [], input: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3947" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3948" style=""> = </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3949" style="color:#e82300;">""</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3950" style="">) -&gt; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3951" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3952" style=""> {</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3953" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3954" style="">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3955" style="color:#35568a;">if</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3956" style=""> </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3957" style="color:#587ea8;">!</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3958" style="">input.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3959" style="color:#587ea8;">isEmpty</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3960" style=""> {</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3961" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3962" style="">&nbsp; &nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3963" style="color:#35568a;">let</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3964" style=""> pipeIn = </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3965" style="color:#c35900;">Pipe</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3966" style="">()</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3967" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3968" style="">&nbsp; &nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3969" style="color:#35568a;">self</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3970" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3971" style="color:#587ea8;">standardInput</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3972" style=""> = pipeIn</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3973" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,119,66);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3974" style="color:#000000;">&nbsp; &nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3975" style=""><i class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3976">// multiple inputs are separated by newline</i></span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3977" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3978" style="">&nbsp; &nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3979" style="color:#35568a;">if</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3980" style=""> </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3981" style="color:#35568a;">let</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3982" style=""> input = input.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3983" style="color:#587ea8;">data</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3984" style="">(using: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3985" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3986" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3987" style="color:#c35900;">Encoding</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3988" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3989" style="color:#587ea8;">utf8</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3990" style="">) {</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3991" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3992" style="color:#000000;">&nbsp; &nbsp; &nbsp; &nbsp; pipeIn.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3993" style="">fileHandleForWriting</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3994" style="color:#000000;">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3995" style="">write</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3996" style="color:#000000;">(input)</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3997" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3998" style="">&nbsp; &nbsp; &nbsp; }</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3999" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4000" style="">&nbsp; &nbsp; }</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4001" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4002" style="">&nbsp;&nbsp; &nbsp;</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4003" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4004" style="">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4005" style="color:#35568a;">let</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4006" style=""> pipeOut = </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4007" style="color:#c35900;">Pipe</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4008" style="">()</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4009" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4010" style="">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4011" style="color:#35568a;">self</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4012" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4013" style="color:#587ea8;">standardOutput</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4014" style=""> = pipeOut</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4015" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4016" style="">&nbsp;&nbsp; &nbsp;</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4017" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4018" style="">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4019" style="color:#35568a;">self</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4020" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4021" style="color:#587ea8;">arguments</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4022" style=""> = arguments</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4023" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4024" style="">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4025" style="color:#35568a;">self</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4026" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4027" style="color:#587ea8;">launchPath</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4028" style=""> = command</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4029" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4030" style="color:#000000;">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4031" style="color:#35568a;">self</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4032" style="color:#000000;">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4033" style="">currentDirectoryPath</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4034" style="color:#000000;"> = currentDir</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4035" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4036" style="">&nbsp;&nbsp; &nbsp;</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4037" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4038" style="">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4039" style="color:#35568a;">self</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4040" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4041" style="color:#587ea8;">launch</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4042" style="">()</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4043" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4044" style="color:#000000;">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4045" style="color:#35568a;">let</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4046" style="color:#000000;"> output = pipeOut.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4047" style="">fileHandleForReading</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4048" style="color:#000000;">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4049" style="">readDataToEndOfFile</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4050" style="color:#000000;">()</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4051" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4052" style="color:#000000;">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4053" style="color:#35568a;">self</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4054" style="color:#000000;">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4055" style="">waitUntilExit</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4056" style="color:#000000;">()</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4057" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4058" style="">&nbsp;&nbsp; &nbsp;</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4059" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4060" style="">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4061" style="color:#35568a;">return</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4062" style=""> </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4063" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4064" style="">(data: output, encoding: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4065" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4066" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4067" style="color:#c35900;">Encoding</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4068" style="">(rawValue: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4069" style="color:#c35900;">String</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4070" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4071" style="color:#c35900;">Encoding</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4072" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4073" style="color:#587ea8;">utf8</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4074" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4075" style="color:#587ea8;">rawValue</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4076" style="">))!</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4077" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4078" style="">&nbsp; }</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4079" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4080" style="">}</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4081" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4082" style=""></span><br clear="none" class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4083"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4084" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,119,66);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4085" style=""><i class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4086">//print(Process().execute(command: "/bin/ls", arguments: ["-l"]))</i></span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4087" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4088" style=""></span><br clear="none" class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4089"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4090" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4091" style="color:#35568a;">var</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4092" style=""> cmd = </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4093" style="color:#c35900;">Process</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4094" style="">()</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4095" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4096" style=""></span><br clear="none" class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4097"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4098" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4099" style="color:#587ea8;">print</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4100" style="color:#000000;">(</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4101" style="">"Starting..."</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4102" style="color:#000000;">)</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4103" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4104" style=""></span><br clear="none" class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4105"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4106" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4107" style="color:#c35900;">DispatchQueue</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4108" style="color:#000000;">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4109" style="">global</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4110" style="color:#000000;">(qos: .</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4111" style="">default</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4112" style="color:#000000;">).</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4113" style="">async</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4114" style="color:#000000;"> {</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4115" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4116" style="color:#000000;">&nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4117" style="color:#587ea8;">print</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4118" style="color:#000000;">(</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4119" style="">"Executing..."</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4120" style="color:#000000;">)</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4121" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4122" style="">&nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4123" style="color:#35568a;">let</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4124" style=""> s = </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4125" style="color:#587ea8;">cmd</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4126" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4127" style="color:#587ea8;">execute</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4128" style="">(command: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4129" style="color:#e82300;">"/bin/ls"</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4130" style="">, arguments: [</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4131" style="color:#e82300;">"-l"</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4132" style="">])</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4133" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4134" style="">&nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4135" style="color:#587ea8;">print</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4136" style="">(s)</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4137" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4138" style="">}</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4139" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4140" style=""></span><br clear="none" class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4141"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4142" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4143" style="color:#c35900;">DispatchQueue</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4144" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4145" style="color:#587ea8;">global</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4146" style="">(qos: .</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4147" style="color:#587ea8;">default</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4148" style="">).</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4149" style="color:#587ea8;">asyncAfter</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4150" style="">(deadline: </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4151" style="color:#c35900;">DispatchTime</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4152" style="">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4153" style="color:#587ea8;">now</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4154" style="">() + .</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4155" style="color:#587ea8;">seconds</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4156" style="">(</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4157" style="color:#0433ff;">5</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4158" style="">)) {</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4159" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4160" style="color:#000000;">&nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4161" style="color:#35568a;">if</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4162" style="color:#000000;"> </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4163" style="">cmd</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4164" style="color:#000000;">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4165" style="">isRunning</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4166" style="color:#000000;"> {</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4167" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4168" style="color:#000000;">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4169" style="color:#587ea8;">print</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4170" style="color:#000000;">(</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4171" style="">"Terminating..."</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4172" style="color:#000000;">)</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4173" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(88,126,168);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4174" style="color:#000000;">&nbsp; &nbsp; </span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4175" style="">cmd</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4176" style="color:#000000;">.</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4177" style="">terminate</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4178" style="color:#000000;">()</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4179" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4180" style="">&nbsp; }</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4181" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4182" style="">}</span></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4183" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px;"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4184" style=""></span><br clear="none" class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4185"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_3008" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;">















































</div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4186" style="margin-top:0px;margin-bottom:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(232,35,0);"><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4187" style="color:#587ea8;">print</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4188" style="color:#000000;">(</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4189" style="">"Done."</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4190" style="color:#000000;">)</span></div><div class="yiv5249362650gmail_msg"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2403">&nbsp;</div><div class="yiv5249362650m_6211223635688417170signature yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2288"><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328"><br clear="none" class="yiv5249362650gmail_msg"></div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328">The code doesn't work as expected. The&nbsp;<span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4226" style="font-family:Menlo;font-size:12px;">execute(</span><span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4238" style="font-family:Menlo;font-size:12px;">)</span>&nbsp;function itself works fine (uncomment the call in the middle of the code), but I don't know why it doesn't work if it's called from within&nbsp;<span class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4246" style="color:rgb(195,89,0);font-family:Menlo;font-size:12px;">DispatchQueue</span>&nbsp;closure. Even if I call a much more simple function —like a for loop— it doesn't work consistenly, sometimes the loop is completed, but other times it's not.</div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328"><br clear="none" class="yiv5249362650gmail_msg"></div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328">Google didn'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 class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328"><br clear="none" class="yiv5249362650gmail_msg"></div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328">Thank you.</div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328"><br clear="none" class="yiv5249362650gmail_msg"></div><div class="yiv5249362650gmail_msg" dir="ltr" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328">Regards,</div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328"><br clear="none" class="yiv5249362650gmail_msg"></div><div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_2328"><br clear="none" class="yiv5249362650gmail_msg"></div>–Mr Bee<div class="yiv5249362650gmail_msg" id="yiv5249362650m_6211223635688417170yui_3_16_0_ym19_1_1483687514550_4403"><br clear="none" class="yiv5249362650gmail_msg"></div></div></div></div>_______________________________________________<br clear="none" class="yiv5249362650gmail_msg">
swift-users mailing list<br clear="none" class="yiv5249362650gmail_msg">
<a rel="nofollow" shape="rect" class="yiv5249362650gmail_msg" ymailto="mailto:swift-users@swift.org" target="_blank" href="mailto:swift-users@swift.org">swift-users@swift.org</a><br clear="none" class="yiv5249362650gmail_msg">
<a rel="nofollow" shape="rect" class="yiv5249362650gmail_msg" target="_blank" href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br clear="none" class="yiv5249362650gmail_msg">
</blockquote></div></div></div></div><br><br></div>  </div> </div>  </div></div></body></html>