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: 103376,c3c4ae45442f569e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada.Text_IO and protected objects (Was: [newbie question] tasks and protected types) References: <1114747457.868019.93210@f14g2000cwb.googlegroups.com> <42720DCD.6030304@mailinator.com> <4272260d$0$30463$ba620e4c@news.skynet.be> <4272a5ce$0$15359$636a15ce@news.free.fr> <1114812712.786763.161730@g14g2000cwa.googlegroups.com> In-Reply-To: <1114812712.786763.161730@g14g2000cwa.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 30 Apr 2005 03:45:12 GMT NNTP-Posting-Host: 67.3.219.142 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1114832712 67.3.219.142 (Fri, 29 Apr 2005 20:45:12 PDT) NNTP-Posting-Date: Fri, 29 Apr 2005 20:45:12 PDT Xref: g2news1.google.com comp.lang.ada:10845 Date: 2005-04-30T03:45:12+00:00 List-Id: fabio de francesco wrote: > Isn't there in GCC/GNAT any options like "-pedantic" and "-ansi" in > order to reject all programs that do not strictly follow the standard? For GNAT, -gnato -fstack-check -gnatE make it strictly follow the standard. That won't affect what happens in your problem. Blocking operations in protected operations are a bounded error. That means don't do it. Doing IO to the same file from multiple tasks may cause interleaving. So the simple solution to your problem as given is to define a subtype of String subtype Task_Name is String (1 .. 6); to use in your entry and Msg object, and have another task to do the output. That should solve your deadlock and be portable. If task names need to be different lengths, then Msg could be an [Un]Bounded_String. -- Jeff Carter "Spam! Spam! Spam! Spam! Spam! Spam! Spam! Spam!" Monty Python's Flying Circus 53