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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e2a9ad4da0a64a87 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news1.google.com!news.germany.com!feeder.news-service.com!proxad.net!cleanfeed2-a.proxad.net!nnrp4-1.free.fr!not-for-mail Return-Path: X-Greylist: delayed 5970 seconds by postgrey-1.24 at green; Fri, 12 Jan 2007 20:20:08 CET x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Timing events in GNAT GPL 2006 Date: Fri, 12 Jan 2007 09:40:19 -0800 In-Reply-To: <1168620554.469932.313660@a75g2000cwd.googlegroups.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Timing events in GNAT GPL 2006 Thread-Index: Acc2anelSeiPCKIqT2uu77Yz1a1YzAABD0+Q From: "Vo, Anh \(US SSA\)" To: "Rolf" , X-OriginalArrivalTime: 12 Jan 2007 17:40:19.0855 (UTC) FILETIME=[BA9EB9F0:01C73670] X-Virus-Scanned: amavisd-new at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.9rc1 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.ada Message-ID: X-Leafnode-NNTP-Posting-Host: 88.191.17.134 Organization: Guest of ProXad - France NNTP-Posting-Date: 12 Jan 2007 20:25:02 MET NNTP-Posting-Host: 88.191.14.223 X-Trace: 1168629902 news-2.free.fr 311 88.191.14.223:34427 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:8122 Date: 2007-01-12T20:25:02+01:00 -- with Ada.Real_Time; use Ada.Real_Time; with Ada.Real_Time.Timing_Events; use Ada.Real_Time.Timing_Events; with Ada.Text_IO; use Ada.Text_IO; procedure Test_Timing_Event is protected Clock_Tick is procedure Inc_Clock (Ev : Timing_Event); end Clock_Tick; Tick : Timing_Event; One_Sec : constant Time_Span :=3D Seconds (1); protected body Clock_Tick is procedure Inc_Clock (Ev : Timing_Event) is begin Put_Line ("Inc_Sec"); -- using Time_Span Set_Handler (Tick, One_Sec, Handler =3D> Inc_Clock'Access); end Inc_Clock; end Clock_Tick; begin -- using absolute time Set_Handler (Tick, Clock + One_Sec, Clock_Tick.Inc_Clock'Access); loop null; end loop; end Test_Timing_Event; -- >> There are three things wrong with your codes. Two of them are critical. 1. The protected procedure Inc_Clock has wrong parameter mode. It must be in out mode. 2. The call Set_Handler from the protected procedure will result in a deadlock it is run. 3. Protected object must be declared at the library level. Yours is not. As the result, non-local pointer cannot point to local object error at lines 20 and 26 I designed for both one shot and periodic timers using Timing Event. If it is helpful, I will post my code here. Just let me know. AV