comp.lang.ada
 help / color / mirror / Atom feed
From: "mferracini" <maurizio.ferracini@gmail.com>
Subject: help in task, what is wrong?
Date: 24 Apr 2005 06:02:15 -0700
Date: 2005-04-24T06:02:15-07:00	[thread overview]
Message-ID: <1114347735.376048.213420@o13g2000cwo.googlegroups.com> (raw)

sorry for the italian source code:

----
with Ada.Text_Io;

procedure Interazione is --processo genitore


   task type Generico is
      entry Init;
      entry Esegui;
   end Generico;

type Ptr_Generico is access Generico;

   task type Schedulatore is
      entry Addtask( my_task : in ptr_Generico);
      entry Parti;
   end Schedulatore;


   task body Generico is
      N2 : Integer;
   begin
      accept Init do
         Ada.Text_Io.Put_Line("Init del task " &Integer'Image(N2));
         end Init;
      loop
         accept Esegui do
         Ada.Text_Io.Put_Line("-Work task " &Integer'Image(N2));
         delay(0.2);
         --exit; --misteri
         end Esegui;
      end loop;
   end Generico;

   task body Schedulatore is
     begin
      accept Parti;
        accept Addtask( My_Task : in ptr_Generico) do
           My_Task.Esegui;
           end addtask;
      null;
   end;

task_x : Ptr_Generico;

  begin --corpo genitore
     Schedulatore.Parti;
   Task_X:=new Generico;
   Task_x.Init;
   schedulatore.Addtask(Task_X);
end Interazione;

---
 schedulatore.Addtask(Task_X); give me this error:
invalid use of subtype mark.

how i can pass the task pointer? thanks




             reply	other threads:[~2005-04-24 13:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-24 13:02 mferracini [this message]
2005-04-24 14:02 ` help in task, what is wrong? Ed Falis
2005-04-24 14:09 ` Adrien Plisson
2005-04-24 15:28   ` mferracini
2005-04-24 18:19 ` Martin Dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox