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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ffc1e,fb45e48e8dddeabd X-Google-Attributes: gidffc1e,public X-Google-Thread: 103376,fb45e48e8dddeabd X-Google-Attributes: gid103376,public From: Laurent Guerby Subject: Re: Ada Protected Object Tutorial #1 Date: 1999/12/17 Message-ID: <86d7s5z8rl.fsf@ppp-111-13.villette.club-internet.fr>#1/1 X-Deja-AN: 562047890 References: <839toq$pu$1@bgtnsc03.worldnet.att.net> <83c5t6$k2q$1@bgtnsc03.worldnet.att.net> X-Trace: front5.grolier.fr 945457363 6364 194.158.111.13 (17 Dec 1999 19:02:43 GMT) Organization: Club-Internet (France) NNTP-Posting-Date: 17 Dec 1999 19:02:43 GMT Newsgroups: comp.programming.threads,comp.lang.ada Date: 1999-12-17T19:02:43+00:00 List-Id: "James S. Rogers" writes: > Example: > > select > Buffer.Read(Item); > or > delay 0.01; -- Delay 0.01 seconds > end select; > > This calls the Read entry on the protected object Buffer. It also starts a > timer. > If the Read completes before the timer alarms, the timer is aborted. > If the timer alarms before the Read completes, the Read is aborted. The semantic you describe here is the one of the (9.7.4) Asynchronous Transfer of Control (select ... then abort), and it is different from the (9.7.2) Timed Entry Calls that you used in your code. To describe what your code does, you should change "Read completes" by "Read is selected" (no longuer waiting on a queue. Once Read code has started, it no longuer matters what the timer does (except in case of use of requeue). --LG