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: a07f3367d7,4b758210c0900d03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news2.google.com!news.glorb.com!aioe.org!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: Protected object which never get finalized Date: Sun, 14 Feb 2010 07:35:47 -0500 Organization: The Wasteland Message-ID: References: NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: g2news1.google.com comp.lang.ada:9213 Date: 2010-02-14T07:35:47-05:00 List-Id: In article , Hibou57 (Yannick DuchĂȘne) wrote: > I may be not lucky : after the case of an object of a protected type > being finalized too much soon, here is now that I have to do with an > object of a protected type which never gets finalized (think I was > to use this latter as a work around after long try failure with the > former, I'm really not lucky at all). > > Inquisitive peoples with interests in the case, may have a look at > the following test : two protected types are defined, with exact > equivalent definition. One is defined in a package, the other is > defined in the local scope. An instance of the first (the one > defined in the package), never get finalized. An instance of the > second type (declared in the local scope), goes through its normal > life. > > But perhaps there's something I did not understood I get the same result with gcc 4.3.4, but it works if protected type A_Type is public in P: package P is protected type A_Type is private Spy : Spies.Instance_Type (Client_Name => new String'("P.A_Type")); end; end P; Type A_Type has its own private part, and this seems more comparable to the declaration of protected type B_Type. Is there any reason to make A_Type more opaque? -- John B. Matthews trashgod at gmail dot com