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!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.posted.plusnet!news.posted.plusnet.POSTED!not-for-mail NNTP-Posting-Date: Fri, 20 Feb 2009 04:18:22 -0600 Newsgroups: comp.lang.ada Followup-To: comp.lang.ada From: Robert_Matthews Subject: Re: Language lawyer question: task activation Date: Fri, 20 Feb 2009 10:18:35 +0000 References: User-Agent: KNode/0.99.01 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Message-ID: <0Ludnf3mRdnyHgPUnZ2dnUVZ8vGdnZ2d@posted.plusnet> X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-xU45vA6Jbjk/BldbPwtkkovICLlgMvKIuDTv+PCoG52I0VLfF7j2JxP1lzUjtfIg1kyDflEOaoSdjxy!tWhFYqENHlG75OxoecXZEyJmIhlct6W5JgQCN/S+ceHTe1+iqRXBkuhE5ncT7HITMuR3PxT60PMp!If+SXbfSHA== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news1.google.com comp.lang.ada:3710 Date: 2009-02-20T10:18:35+00:00 List-Id: Adam Beneschan wrote: > 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. 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; But isn't there another issue here: task types are limited, therefore Func is a constructor function, but in what object does it construct its returned value? Robert