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-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!ramfeed-1.ams.xsnews.nl!feed.xsnews.nl!border-4.ams.xsnews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Tasks reinitializing Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.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: <0bf2270c-6998-41f1-9895-b545026f312e@o21g2000vbl.googlegroups.com> Date: Fri, 18 Sep 2009 09:57:44 +0200 Message-ID: <9cnotgvojmiu.houhcidij6t0$.dlg@40tude.net> NNTP-Posting-Date: 18 Sep 2009 09:57:44 CEST NNTP-Posting-Host: d3fc6fc1.newsspool1.arcor-online.net X-Trace: DXC=\VhASd`NYE0LNKYb?b>076ic==]BZ:af>4Fo<]lROoR1^YC2XCjHcb9kSWNOGakg2QDIMgU:dkh9 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8380 Date: 2009-09-18T09:57:44+02:00 List-Id: On Thu, 17 Sep 2009 11:21:41 -0700 (PDT), Pablo wrote: > How can I reinitialize a task? > Say us, I have two cases: > A task defined as > task type Task_type is > entry Start; > end Task_type; > so the object defined as > Init : Init_type; > > and inside a procedure, the task is initialized with > accept Start; > > and now: > 1) In run time, the task is terminated by aborting process (abort > Init) before its end, and in the same session, I need to turn it on > again, but now from the beginning. If the process is aborted, all its tasks are dead. You probably mean aborting the task. Then just do not abort it if you steel need it. > 2) In run time, the task is finished by very end, and in the same > session, I need to start it again from beginning. task body Task_type is begin loop select accept Start; -- Wait for a session to start ... -- Do what has to be done in this session or terminate; -- Complete when no more needed end select; end loop; end Task_type; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de