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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5b15c37c5d0c986f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!news.astraweb.com!newsrouter-eu.astraweb.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Designing Timers using Ada.Real_Time.Timing_Events package Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1143317010.868435.251190@v46g2000cwv.googlegroups.com> <1d4yew2i587h5.1h8dilwbda4zv.dlg@40tude.net> <1143351567.528574.297850@z34g2000cwc.googlegroups.com> <1fiau0e4pe84o$.gulfgysczk5i$.dlg@40tude.net> <1143389936.844624.243020@i40g2000cwc.googlegroups.com> <1143402228.182836.29570@v46g2000cwv.googlegroups.com> <1pvsgg60odxin$.16vcgq2jyhf8g$.dlg@40tude.net> Date: Mon, 27 Mar 2006 20:14:01 +0200 Message-ID: NNTP-Posting-Date: 27 Mar 2006 20:13:50 MEST NNTP-Posting-Host: 3ab072dc.newsread2.arcor-online.net X-Trace: DXC=N>=o^Fme\VVJ<1FClJbQ`\Q5U85hF6f;TjW\KbG]kaMXDAHcn;Zl5eXi2^lnm@?[eT[6LHn;2LCV^[ On Mon, 27 Mar 2006 09:49:59 +0200, Dmitry A. Kazakov wrote: > -- Main entrance (is closed during notification) The reason is > -- to aviod irace condition upon timer event. Otherwise a task > -- might get it twice. > entry Wait_For when Inactive or not Occured is > if Inactive then > raise Timer_Canceled; > else > requeue Wait_Notify with abort; > end if; > end Wait_For; > > -- The notification queue, this is a private entry point to gather > -- the waiting requests. > entry Wait_Notify when Inactive or Occured is > if Inactive then > raise Timer_Canceled; I forgot to reset it: else Occurred := Wait_Notify'Count > 0; > end if; > end Wait_Notify; > > procedure Set (Period : Time_Span) is > begin > -- attach Signal to the timer > Inactive := False; > end Set; > > procedure Signal (...) is > Occurred := True; > end Signal; > > procedure Stop is > -- detach Signal from the timer > Inactive := True; > end Stop; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de