From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ce290b2dd8bc80e8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!out01b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!newsfeed.yul.equant.net!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Need info about Ada tasks Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1r3nd4190fqnicb4tdebo1ctt70cjetnhi@4ax.com> Date: Thu, 25 Sep 2008 15:49:28 +0200 Message-ID: <38vvmtnic6su$.13akh3j9qqeli$.dlg@40tude.net> NNTP-Posting-Date: 25 Sep 2008 15:49:28 CEST NNTP-Posting-Host: a72cedfb.newsspool1.arcor-online.net X-Trace: DXC=8G`<@FB\Mm>nBOkdL^Lo7>ic==]BZ:af>4Fo<]lROoR14nDHegD_]R5MoK]L;5mAN7DNcfSJ;bb[5FCTGGVUmh?4LK[5LiR>kg2jG00_gAlNI= X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7813 Date: 2008-09-25T15:49:28+02:00 List-Id: On Thu, 25 Sep 2008 13:31:27 GMT, Fionn Mac Cumhaill wrote: > My simple solution has a minor problem; I have a select just after the > display routine that receives the abort message, but if the message > doesn't arrive on time I get another iteration of the loop before the > task aborts. How can I make this thing abort immediately, even when I > have a delay(60.0) to give a 1-minute delay between display refreshes? > I.e., how do I bail out in the middle of a delay? 1. If the abort event is implemented as a protected object: task body Refresh_Engine is begin loop ... -- Refresh the display select -- Timed entry call Abort_Event.Wait; exit; or delay 60.0; end select; end loop; end Refresh_Engine; 2. If the abort event is signaled by an entry call: task body Refresh_Engine is begin loop ... -- Refresh the display select -- Selective accept with a time out alternative accept Abort_Event; exit; or delay 60.0; end select; end loop; end Refresh_Engine; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de