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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e1c47fd1b76b1c05,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Task entries and access to subprograms. Date: Wed, 06 Apr 2005 12:25:27 +0200 Message-ID: <4253B917.5070800@mailinator.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net XY3h2wMqCaDbhpUozr4nNA0TtT/aIb/WOwuc1iPgolIthZKGk= User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en Xref: g2news1.google.com comp.lang.ada:10292 Date: 2005-04-06T12:25:27+02:00 List-Id: Hi, this is a question about the validity of some approach I'm trying. I know that task entries can't have access parameters. My gnat gap 1.1.0 linux behaves like that: type AInt is access all Integer; type Code is access procedure; task type Blah is entry One (I : access Integer); -- Illegal and detected. entry Two (I : AInt); -- No complaint. Legal? entry Three (C : not null access procedure); -- Illegal and detected. -- I have the Ada0Y features enabled. entry Four (C : Code); -- No complaint. end Blah; I want to execute some arbitrary code inside a task. This is because GtkAda in win32 requires all Gtk calls to be made from the same thread, and I want to have code outside of that thread able to make Gtk calls (for abstraction and future extension purposes I don't want to hardcode all my Gtk calls in that task). Apparently the fourth approach works under linux, but I'm worried it may be a bad trick. If this isn't legal I could use a tagged type with a defined Execute method, so I'd pass instances of derived types of this base class to the task, and execute the dispatching call. I'm interested in your oppinion about the second and fourth entries above, and in other alternatives to the tagged type workaround. Thanks!