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,7897733b1978b6a4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.28.135 with SMTP id b7mr228694pbh.8.1321546976296; Thu, 17 Nov 2011 08:22:56 -0800 (PST) Path: h5ni1943pba.0!nntp.google.com!news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Freezing a task Date: Thu, 17 Nov 2011 17:22:57 +0100 Organization: cbb software GmbH Message-ID: References: <32992849.648.1321544004241.JavaMail.geo-discussion-forums@vbmh5> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: uj8eDODkXPBoTj2NquW7bg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news2.google.com comp.lang.ada:14436 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-11-17T17:22:57+01:00 List-Id: On Thu, 17 Nov 2011 16:00:17 +0000, Simon Wright wrote: > "Rego, P." writes: > >> Is there a more elegant way to do this? Maybe some procedure >> My_Task.FreezeNow in a unknown (by me) package? Thanks > > Well, you could do it in the debugger :-) > > Programmatically, no. Your choices for inter-task comms are (a) the > rendezvous, (b) polling some shared resource (eg a protected object), > (c) something using sockets. > > Or you could unilaterally abort the task, which would be the end of it. > > For (a), maybe something like > > loop > select > accept Pause; > accept Continue; > else > null; > end select; > -- do stuff > end loop; If using select statement for accepting entry calls then: Paused : Boolean := False; begin loop if Paused then accept Release; Paused := False; else select accept Pause; Paused := True; else ... -- Do stuff end select; end if; end loop; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de