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-04 01:31:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!newsfeed.esat.net!feeder.news.heanet.ie!surfnet.nl!news.wind.surfnet.nl!news.nl.linux.org!humbolt.nl.linux.org!transit.news.xs4all.nl!news.xs4all.nl!not-for-mail Sender: Fraser@FWILSON From: Fraser Wilson Newsgroups: comp.lang.ada Subject: Re: new_line in a put_line References: <1ec946d1.0212020657.2bd8b5c@posting.google.com> Date: 04 Dec 2002 10:31:15 +0100 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 80.126.24.12 X-Trace: 1038994289 news.xs4all.nl 11744 80.126.24.12:64841 Xref: archiver1.google.com comp.lang.ada:31404 Date: 2002-12-04T10:31:15+01:00 List-Id: Dmitry A. Kazakov writes: > Just do not do I/O from them. Define a mutex as a protected object and > a spin lock as a controlled type (less troubles with releasing a > mutex): [..] > procedure Put_Line (Text : String) is > Get_It : Lock (Write_Mutex'Access); > begin > Ada.Text_IO.Put_Line (Text); > end Put_Line; Something inside me rebels at using side-effects from a declaration like that. I can't really talk; my database library unlocks objects as they go out of scope, but ... well, I know that code gets executed in declarations, but I don't necessarily want to be this aware of it. On the other hand, it's just a monitor, I shouldn't be so scared :) cheers, Fraser.