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,c33f8f65997c21d0,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.88.195 with SMTP id bi3mr1107171wib.3.1348078928720; Wed, 19 Sep 2012 11:22:08 -0700 (PDT) Path: q11ni136372285wiw.1!nntp.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Problem with task component Date: Wed, 19 Sep 2012 19:22:07 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="5f22ba276a4b4f77c63ae2949e7306f1"; logging-data="22339"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/o8LM7YwKX1ydNzOYXg/i43RZa4mJCrfk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:UxeIFqNAW1EC9+YLVJNdYbDIQdU= sha1:E6sD04Ky4fRt0Z/iP+IUbnvQObc= Content-Type: text/plain Date: 2012-09-19T19:22:07+01:00 List-Id: If a Limited_Controlled type has a component of a task type, is it wrong to call an entry of the task from Initialize? When I do, the caller blocks. package Chips is type Chip is limited private; private task type Polling_Task (For_Chip : not null access Chip) is entry Start; entry Stop; end Polling_Task; type Chip is new Ada.Finalization.Limited_Controlled with record Polling_Interval : Duration := 0.1; Poller : Polling_Task (For_Chip => Chip'Access); end record; overriding procedure Initialize (C : in out Chip); ... package body Chips is task body Polling_Task is begin accept Start; ... end Polling_Task; overriding procedure Initialize (C : in out Chip) is begin C.Poller.Start; <=========== sticks here end Initialize; ... If the task won't start executing until its instance is completely elaborated and initialized, I don't need the entry Start in any case.