From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Freeing access-to-task objects Date: Sat, 1 Oct 2022 13:40:03 +0200 Organization: Adalog Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 1 Oct 2022 11:40:03 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="f99a5a34ec8b6e3de08bff1d4a29b1fd"; logging-data="1406938"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wq5mOjrvcr+h4dWSuTvnP" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Cancel-Lock: sha1:d7H9qX/pQn7SIPTbhNYmYgYgDwk= Content-Language: fr In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64470 List-Id: Le 30/09/2022 à 12:16, Emmanuel Briot a écrit : > Please find a new blog post at: > > https://deepbluecap.com/freeing-task-access-objects/ > > Abstract: > Freeing Ada tasks could result in accessing freed memory. This post describes the proper way of freeing access-to-task objects. I don't like an active loop to wait for task termination. There are other ways: 1) declare the access type in a block, which is then the master of the tasks. When you exit the block, the tasks are terminated. 2) declare in the tasks an entry which is never accepted, then call this entry from the main. When the task terminates, it raises tasking_error in the (unserved) callers - you can free the task from the exception handler. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52 https://www.adalog.fr