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: a07f3367d7,25642dc8f94534f6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!ecngs!feeder2.ecngs.de!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Basic question about select 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: Date: Wed, 28 Apr 2010 20:36:22 +0200 Message-ID: <1p2m3s7y70lsa$.79fl3we9edva$.dlg@40tude.net> NNTP-Posting-Date: 28 Apr 2010 20:36:19 CEST NNTP-Posting-Host: 8974b3be.newsspool2.arcor-online.net X-Trace: DXC=D^4f>blBkPl<6cDJZfMd_cA9EHlD;3Ycb4Fo<]lROoRa8kF On Wed, 28 Apr 2010 18:16:44 +0000 (UTC), John Wilkinson wrote: > select > PID.Call; --an entry call to task PID > Status := P; > then abort > delay 10.0; > Status := Q; > end select; > > Is the above valid Ada code? It's been handed to me by someone, I > don't really know much about Ada, and I'm supposed to understand > what it does. I can't find any information on "abort" or even > "then". See ARM 9.7.4 Asynchronous Transfer of Control > If it's valid, what does it do? It waits 10s and then assigns Q to Status. But if within these 10s + the time needed to assign Status, the task PID accepts Call, then the sequence introduced by "then abort" is aborted, Call is performed, and finally, P is assigned to Status. Note that the recommended way to do this is the timed entry call ARM 9.7.2: select PID.Call; -- call to task PID Status := P; or delay 10.0; -- wait to longer than 10s Status := Q; end select; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de