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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,95a195198c452b32,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!not-for-mail From: ssh9614@hotmail.com (Bj?rn) Newsgroups: comp.lang.ada Subject: Finalization of a record containing a task Date: 16 Feb 2005 12:35:30 -0800 Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 213.114.86.220 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1108586131 3545 127.0.0.1 (16 Feb 2005 20:35:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 16 Feb 2005 20:35:31 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:8358 Date: 2005-02-16T12:35:30-08:00 List-Id: I'm trying to implement a form of self modifying ADT, containing an active task. I would prefer that the user of the ADT not need to do any "extra" operations on the ADT when the user is finished with it, rather have the task terminate automatically when the type goes out of scope. I do not see how I can manage this since the ADT does not seem to finalize as long as the tasks have not terminated. How can I solve this? Should I rather try a different approach? Currently it looks something like this: package PKG is type T_ADT is new Limited_Controlled with private ... private task type T_Worker is entry Start; entry Stop; ... end task; procedure Initialize (T : in out T_ADT); procedure Finalize (T : in out T_ADT); type T_ADT is new Limited_Controlled with record X : Some_Type; Worker : T_Worker; end record; end PKG; 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; end select; end loop; end PKG; Best regards, Bj�rn