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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: weird block on Get from basic protected bounded buffer with 2 tasks Date: Tue, 12 Dec 2017 21:18:53 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 12 Dec 2017 20:18:53 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="23dadee4c5ffc9d91647a3d1d2d1542c"; logging-data="2420"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QcYDXCMD7qhNCaTN8FQMb2JHHi9BToKE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:da/TLuEG0atk0z+Itt6FOjJD4GQ= Xref: reader02.eternal-september.org comp.lang.ada:49456 Date: 2017-12-12T21:18:53+01:00 List-Id: On 12/12/2017 08:08 PM, George Shapovalov wrote: > > abort Getter; Getter isn't blocking; it's been aborted. There's a deadlock: if Get is called 1st, it blocks because Count = 0. If Put is then called, it blocks because Get'Count > 0. Nothing can then change Count unless the call to Get is aborted. If I change the abort statement to "null;" and remove the check on Get'Count in Put's barrier, it works fine for me. -- Jeff Carter "Since I strongly believe that overpopulation is by far the greatest problem in the world, this [Soylent Green] would be my only message movie." Charleton Heston 123