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.2 required=5.0 tests=BAYES_00,FROM_WORDY, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e93e343bdf618340 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feed2.news.rcn.net!rcn!feed3.news.rcn.net!not-for-mail Reply-To: "Frank J. Lhota" From: "Frank J. Lhota" Newsgroups: comp.lang.ada References: Subject: Re: Problem with tasks Date: Sat, 4 Sep 2004 06:51:40 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: <41399e3a$0$19705$61fed72c@news.rcn.com> X-Trace: DXC=Fa_`Vogg^iP6S0io2g2UX]0R]m=BkYWIW:6bU3OT9S9Z3?f;=fXOXk]7iCYiCGb00^ZKR[b9md8LP X-Complaints-To: abuse@rcn.com Xref: g2news1.google.com comp.lang.ada:3312 Date: 2004-09-04T06:51:40-04:00 List-Id: "Magik" wrote in message news:chc076$i96$1@nemesis.news.tpi.pl... > Hello. > > 1. Proces_Alarmu.Start -> Yes OK! > 2. Proces_Alarmu.Stop -> Yes OK! > But > 3. Proces_Alarmu.Start - Why does not start again exercise? Because Proces_Alarmu was not written that way. After the Stop entry was called, the Proces_Alarmu task exits the loop and finishes its body of code. Task entries do NOT work like external "goto" statements: if you want Proces_Alarmu to service the Start entry, then the code for Proces_Alarmu must be able to get to an "accept Start" call. Whenever one has a problem of this sort, it is advisable to include a description of how you want the task to behave. Assuming that Proces_Alarmu is supposed to alternately accept Start and Stop entries, and print "test" once a second until the Stop entry was called, then Proces_Alarmu could be written like this: task Proces_Alarmu is entry Start; entry Stop; end Proces_Alarmu; task body Proces_Alarmu is begin For_Each_Start_Stop: loop accept Start; Until_Stop: loop select accept Stop; exit; or delay 1.0; put("test"); end select; end loop Until_Stop; end loop For_Each_Start_Stop; end Proces_Alarmu;