From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Designing Timers using Ada.Real_Time.Timing_Events package
Date: Mon, 27 Mar 2006 20:14:01 +0200
Date: 2006-03-27T20:13:50+02:00 [thread overview]
Message-ID: <d2ep9c3faxgs.ryd6b33zfgv8.dlg@40tude.net> (raw)
In-Reply-To: 1pvsgg60odxin$.16vcgq2jyhf8g$.dlg@40tude.net
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
next prev parent reply other threads:[~2006-03-27 18:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-25 20:03 Designing Timers using Ada.Real_Time.Timing_Events package Anh Vo
2006-03-25 20:58 ` Dmitry A. Kazakov
2006-03-26 5:39 ` Anh Vo
2006-03-26 12:58 ` Dmitry A. Kazakov
2006-03-26 16:18 ` Anh Vo
2006-03-26 18:22 ` Dmitry A. Kazakov
2006-03-26 19:43 ` Anh Vo
[not found] ` <3itd22hcekts5lsojdqjnn966bbvc8fckh@4ax.com>
2006-03-26 23:53 ` Anh Vo
[not found] ` <0mae22lshe5nee8pt8h7seussloebv07g3@4ax.com>
2006-03-27 5:01 ` Anh Vo
[not found] ` <5vse22h4mc1och27s0nkbv986csi2rorki@4ax.com>
2006-03-28 0:07 ` Anh Vo
2006-03-27 7:49 ` Dmitry A. Kazakov
2006-03-27 18:14 ` Dmitry A. Kazakov [this message]
2006-03-27 22:00 ` Anh Vo
2006-03-28 7:51 ` Dmitry A. Kazakov
2006-03-28 16:00 ` Anh Vo
2006-03-26 7:59 ` Martin Krischik
2006-03-26 15:50 ` Anh Vo
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox