comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Rendezvous with select ... else and "or terminate" not possible - but how do I quit this task?
Date: Thu, 1 Sep 2016 18:05:37 +0200
Date: 2016-09-01T18:05:37+02:00	[thread overview]
Message-ID: <nq9jkl$df7$1@dont-email.me> (raw)
In-Reply-To: <6e4d6fc1-dcb9-454a-8c1e-df090224438e@googlegroups.com>

Le 01/09/2016 à 17:43, Some Dude a écrit :

Small remark: you can get rid of "Done":

task body Connection_Handler is
begin
      accept Start (Socket : Socket_Type) do
        -- do this first
      end Start;
      loop
         select
            accept Stop;
            exit;
         or
            accept Send (Socket : Socket_Type; Command : Command_Type) do
               -- do something
            end Send;
         or
            accept Close (Socket : Socket_Type) do
               -- do something
             end Close;
         else
             -- receive data if necessary using GNAT.sockets.Check_Selector
             -- while no data is sent
         end select;
      end loop;
end Connection_Handler;

> However, when Stop is called and Done set to True, I get 
> 
>   raised TASKING_ERROR : s-tasren.adb:445
Presumably, this is due to some other task trying to rendezvous with
Connection_Handler after it has completed.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

  reply	other threads:[~2016-09-01 16:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 15:43 Rendezvous with select ... else and "or terminate" not possible - but how do I quit this task? Some Dude
2016-09-01 16:05 ` J-P. Rosen [this message]
2016-09-01 16:10 ` Dmitry A. Kazakov
2016-09-01 21:30 ` Some Dude
replies disabled

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