comp.lang.ada
 help / color / mirror / Atom feed
* help in task, what is wrong?
@ 2005-04-24 13:02 mferracini
  2005-04-24 14:02 ` Ed Falis
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: mferracini @ 2005-04-24 13:02 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-04-24 18:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-24 13:02 help in task, what is wrong? mferracini
2005-04-24 14:02 ` Ed Falis
2005-04-24 14:09 ` Adrien Plisson
2005-04-24 15:28   ` mferracini
2005-04-24 18:19 ` Martin Dowie

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