comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Finalization of a record containing a task
Date: 16 Feb 2005 17:08:30 -0500
Date: 2005-02-16T17:08:30-05:00	[thread overview]
Message-ID: <wccy8doxin5.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: mailman.146.1108586972.527.comp.lang.ada@ada-france.org

Stephen Leake <stephen_leake@acm.org> 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



  parent reply	other threads:[~2005-02-16 22:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-16 20:35 Finalization of a record containing a task Bj?rn
2005-02-16 20:49 ` Stephen Leake
2005-02-16 21:20   ` Adrien Plisson
2005-02-16 22:09     ` Robert A Duff
2005-02-17  8:24       ` Adrien Plisson
2005-02-18  0:17         ` Robert A Duff
2005-02-17  9:13     ` Dmitry A. Kazakov
2005-02-18  0:13       ` Robert A Duff
2005-02-18  2:34         ` Randy Brukardt
2005-02-18 11:27         ` Dmitry A. Kazakov
2005-02-16 22:08   ` Robert A Duff [this message]
2005-02-21 13:20     ` Craig Carey
2005-02-21 21:41       ` Robert A Duff
2005-02-22  0:15         ` Randy Brukardt
2005-02-17 17:50   ` Bj?rn
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox