comp.lang.ada
 help / color / mirror / Atom feed
* How to make a task wait and resume ?
@ 2019-01-17 16:21 reinert
  2019-01-17 17:28 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 5+ messages in thread
From: reinert @ 2019-01-17 16:21 UTC (permalink / raw)


Hi there,

I have used a protected object to control (from "outside") 
wait/resume of a task. It works, but is it good practise?

Below is an illustration on what I mean. Hope you get it :-)

reinert  

   protected pause1 is
     entry wait1;
     procedure halt1;
     procedure resume1;
   private
     OK : boolean := false;
   end pause1;

   protected body pause1 is

     entry wait1 when OK is
     begin
        null;
     end wait1;

     procedure halt1 is
     begin
       OK := false;
     end halt1;

     procedure resume1 is
     begin
       OK := true;
     end resume1;
   end pause1;

   task body task1 is 
   begin
     loop
       pause1.wait1;
       do_something;
     end loop;
   end task1;


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

end of thread, other threads:[~2019-01-18 10:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 16:21 How to make a task wait and resume ? reinert
2019-01-17 17:28 ` Dmitry A. Kazakov
2019-01-17 22:28   ` Randy Brukardt
2019-01-18  7:59     ` reinert
2019-01-18 10:20       ` Dmitry A. Kazakov

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