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,6009c73a58f787a0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-12 14:00:42 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: How to avoid unreferenced objects (mutexes etc) Date: Sat, 12 Jan 2002 17:04:59 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3c3ee8c8.105408250@News.CIS.DFN.DE> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:18836 Date: 2002-01-12T17:04:59-05:00 List-Id: "Nick Roberts" wrote in message news:a1o2h1$sfe3f$5@ID-25716.news.dfncis.de... > However, really, a much better design is like this: No, because protected operations can't make blocking calls. Note that all predefined I/O packages are "potentially blocking," which means, for example, that you can't call Text_IO from inside a protected object. So you still need a semaphore-style type (as in the original post), to handle the situation in which blocking calls are made inside a critical section. The technique shown using a Limited_Controlled type to automatically seize and release the semaphore is a standard Ada95 idiom.