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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,95a195198c452b32 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Finalization of a record containing a task Date: 16 Feb 2005 17:08:30 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01-e.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1108591710 3589 69.38.147.31 (16 Feb 2005 22:08:30 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 16 Feb 2005 22:08:30 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:8363 Date: 2005-02-16T17:08:30-05:00 List-Id: Stephen Leake writes: > you need to have a 'select' statement, with an open 'terminate' > alternative. That works in some cases, but you can't mix delay alternatives with terminate alternatives. Maybe you could replace the delay with an accept, and arrange for some other task to call that entry periodically. But then how do you get rid of that *other* task? You also can't mix entry calls with terminate alternatives, so if the task wants to talk to a protected object, you're stuck. > > package body PKG is > > task T_Worker is > > {Inner task of T_Worker} > > begin > > loop > > select > > accept Start; > > or > > accept Stop; > > or > > ... > > or > > delay until Some_Time; > > or terminate; > > > end select; > > end loop; > > end PKG; > > -- > -- Stephe - Bob