comp.lang.ada
 help / color / mirror / Atom feed
From: "Tomek Wałkuski" <tomek.walkuski@gmail.com>
Subject: Re: Ada and (SIGTERM?)
Date: Sat, 8 Aug 2009 06:11:28 -0700 (PDT)
Date: 2009-08-08T06:11:28-07:00	[thread overview]
Message-ID: <103641e8-0738-4b10-b2c6-cbfb53b50d98@d34g2000vbm.googlegroups.com> (raw)
In-Reply-To: a48ec6ae-c0c8-41fb-bdba-2c63c9411028@r24g2000vbn.googlegroups.com

> protected type Interrupt_Handler is
>    procedure Handler;
>    pragma Attach_Handler (Handler, 15); -- is it correct for SIGTERM?
>
>    function Quit return Boolean;
> private
>    Q : Boolean := False;
> end Interrupt_Handler;
>
> protected body Interrupt_Handler is
>    procedure Handler is
>    begin
>       Q := True;
>    end Handler;
>
>    function Quit return Boolean is
>    begin
>       return Q;
>    end Quit;
> end Interrupt_Handler;
>
> Then... somewhere Interrupt_Handler is declared and loop looks like:
>
> while not Quit loop
>    Do_Something;
> end loop;
>
I cannot stop task if Do_Something is Accept_Socket from GNAT.Sockets.

There is a listener which waits for client connections and then
delegates jobs to the worker tasks. I want to stop all tasks and
finalize all objects when SIGTERM is fired.



  parent reply	other threads:[~2009-08-08 13:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-05 19:58 Ada and (SIGTERM?) Tomek Walkuski
2009-08-06  1:06 ` Adam Beneschan
2009-08-06 18:13   ` sjw
2009-08-06 18:48     ` Adam Beneschan
2009-08-06 19:30   ` Tomek Wałkuski
2009-08-06 19:57     ` Jeffrey R. Carter
2009-08-06 20:02       ` Tomek Wałkuski
2009-08-06 20:00     ` okellogg
2009-08-08 13:11     ` Tomek Wałkuski [this message]
2009-08-08 15:06       ` Maciej Sobczak
2009-08-08 17:53         ` Tomek Wałkuski
2009-08-16 13:11           ` Tomek Wałkuski
2009-08-16 15:47             ` Maciej Sobczak
replies disabled

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