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,78546269947cb927 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-30 14:47:28 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsfeed.stueberl.de!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Combining entry_call, accept_statment and terminate_statment Date: Tue, 30 Mar 2004 22:47:27 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <106h7clrs4iio8c@corp.supernews.com> <106jkmlj2g6ik57@corp.supernews.com> NNTP-Posting-Host: belenus.iks-jena.de X-Trace: branwen.iks-jena.de 1080686847 22175 217.17.192.34 (30 Mar 2004 22:47:27 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 30 Mar 2004 22:47:27 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:6677 Date: 2004-03-30T22:47:27+00:00 List-Id: * Randy Brukardt wrote: > "Lutz Donnerhacke" wrote in message >> That's exactly my current implementation. But I increased the delay and >> noticed, that the entry_barrier of the delayed entry_call is evaluated >> only once on startup of the timed entry call. If the barrier becomes >> true while the delay is running, the delay is not aborted. >> >> A reason for this strange behavior might be a call to a protected function >> in the entry_barrier itself. > > Barriers of a PO are re-evaluated whenever a protected action ends, and when > an entry is called. A barrier which can change state without a protected > action ending is incorrect and may not work properly. So cascading of protected types will not work. My incorrect version was: protected type Ringbuffer is procedure Put(data : in String); procedure Get(data : out Buffer; last : out Extended_Buffer_Offset; missed : out Absolute_Position; pos : in out Absolute_Position); function Is_New(pos : Absolute_Position) return Boolean; private buf : Buffer; start, stop : Absolute_Position := Absolute_Position'First; end Ringbuffer; protected type Read_Context(ringbuf : access Ringbuffer) is entry Get(data : out Buffer; last : out Extended_Buffer_Offset; missed : out Absolute_Position); private pos : Absolute_Position := Absolute_Position'First; end Read_Context; protected body Read_Context is entry Get( data : out Buffer; last : out Extended_Buffer_Offset; missed : out Absolute_Position ) when ringbuf.Is_New(pos) is begin ringbuf.Get(data, last, missed, pos); end Get; end Read_Context;