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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,90108ed846e3f1bf X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Language lawyer question: task activation Date: Thu, 19 Feb 2009 18:54:50 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1235087690 21549 192.74.137.71 (19 Feb 2009 23:54:50 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 19 Feb 2009 23:54:50 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:K3CC/GgBYK9vk9x0+LT1WzDrcFU= Xref: g2news1.google.com comp.lang.ada:3707 Date: 2009-02-19T18:54:50-05:00 List-Id: Adam Beneschan writes: > Should this program deadlock? I don't think it should (and I think it > should display "E1 accepted"), based on my understanding about when > task activation is supposed to occur for the function result. I think you're right. The task should be activated after Func returns, before calling Do_It. >...But > perhaps there's something about the relation between task activation > and masters that I don't understand. Anyway, this hangs when I > compile it with GNAT and run it---is this correct or not? > > -- thanks, Adam > > with Text_IO; > procedure Test is > > task type TType is > entry E1; > end TType; > > task body TType is > begin > accept E1 do > Text_IO.Put_Line ("E1 accepted"); > end E1; > end TType; > > function Func return TType is > begin > return X : TType; > end Func; > > procedure Do_It (X : TType) is > begin > X.E1; > end Do_It; > > begin > Do_It (Func); > end Test; - Bob