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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a046ce7f5ee1fa51 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-05 01:44:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: new_line in a put_line Date: Thu, 05 Dec 2002 10:44:16 +0100 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1039081456 30132359 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:31458 Date: 2002-12-05T10:44:16+01:00 List-Id: On Thu, 5 Dec 2002 07:16:10 +0100 (MET), "Grein, Christoph" wrote: >> You might also pack seizing the mutex into a "proxy" object >> (File_Channel): >> >> type File_Channel is limited private; >> procedure Put (File : in out File_Channel; Text : String); >> procedure Put_Line (File : in out File_Channel; Text : String); >> procedure New_Line (File : in out File_Channel; Text : String); >> ... >> private >> type File_Channel is >> new Ada.Finalization.Limited_Controlled with null record; >> procedure Initialize (File : in out File_Channel); >> procedure Finalize (File : in out File_Channel); >> >> Initialize would seize the mutex, Finalize would release it. Thus only >> one instance of File_Channel may exist at a time. > >No, nothing prevents you from declaring lots of File_Channel objects concurrently, even >arrays of them. OK, bad wording, I admit. Under "exists" I actually meant "exists at run-time and is fully initialized". --- Regards, Dmitry Kazakov www.dmitry-kazakov.de