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=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,ec570d1a83fda83c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-25 02:50:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!fr.usenet-edu.net!usenet-edu.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: Problem with tasks Date: Wed, 25 Jul 2001 11:32:58 +0200 Organization: Adalog Message-ID: <9jm4kp$8ak$1@s1.read.news.oleane.net> References: <3b5e887e.10671695@news.bt.es> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 996054489 8532 195.25.228.57 (25 Jul 2001 09:48:09 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 25 Jul 2001 09:48:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:10555 Date: 2001-07-25T11:32:58+02:00 List-Id: "Carlos Aganzo" a �crit dans le message news: 3b5e887e.10671695@news.bt.es... > I need to create a new instance of the same task from itself, > something like > > type acell is access cell; > > task body cell is > anon: acell; > begin > anon := new cell; > -- more code > end cell; > > > How could I do this? A task type name designates the current instance within its own body, so that you can write: abort cell; to abort the current task. If you want to use it as the type name, just declare a subtype: subtype Cell_Again is Cell; -- declaration must be outside body! task body cell is anon: acell; begin anon := new cell_Again; -- more code end cell; -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr