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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Termination of periodic tasks Date: Mon, 16 Jun 2014 10:08:58 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 16 Jun 2014 17:09:00 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="ba346f17b503f6aa8ecbfd6d1e2a9f59"; logging-data="18748"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uqWlRNKHMOdH2+aaoYvYUNUmzVOm/5TE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:9NhOk9XKytv38z1NcsYKEqnzsYU= X-Original-Bytes: 2638 Xref: number.nntp.dca.giganews.com comp.lang.ada:186976 Date: 2014-06-16T10:08:58-07:00 List-Id: On 06/16/2014 07:02 AM, Natasha Kerensikova wrote: > > package To_Be_Discussed is > > task type Typed_Task is > entry Terminate; > end Typed_Task; > > type Task_Access is access Typed_Task; > > task Singleton_Task is > entry Terminate; > end Singleton_Task; > > type Watcher is new Ada.Finalization.Limited_Controlled with record > Signal_Target : Task_Access; > end record; > > overriding procedure Finalize (Object : in out Watcher); > > end To_Be_Discussed; ARM 9.3 says, "If the task is created by the evaluation of an allocator for a given access type, it depends on each master that includes the elaboration of the declaration of the ultimate ancestor of the given access type." The master of a task designated by a Task_Access is the environment task, assuming To_Be_Discussed to be a library unit. Meanwhile, finalization of an object of type Watcher will happen when you exit the scope of whatever unit declares the object. Those will usually be different if the object is declared outside of To_Be_Discussed. I'm not clear about the case where the object is declared inside To_Be_Discussed. -- Jeff Carter "Hello! Smelly English K...niggets." Monty Python & the Holy Grail 08