comp.lang.ada
 help / color / mirror / Atom feed
From: shaunpatterson@gmail.com
Subject: Ada Thread Termination
Date: Sat, 2 Feb 2008 11:41:55 -0800 (PST)
Date: 2008-02-02T11:41:55-08:00	[thread overview]
Message-ID: <f7866882-e806-46a6-a97e-a33bdf042338@e10g2000prf.googlegroups.com> (raw)

I have a socket listening thread that I would like to be able to
terminate via a select call.

task body Socket_Listener is
  begin
     accept Initialize do
           -- setup
     end Initialize;

     loop
           Listen_For_Message;
     end loop;
  end Socket_Listener

I would like to have another accept statement inside the loop to break
out of the loop.

Listen_For_Message is actually a call to a blocking socket read, so
the call may not finish if nothing else comes through the socket. I'm
not sure how to structure this thread so it can be terminated on
demand.

Any ideas?

Thanks

--
Shaun



             reply	other threads:[~2008-02-02 19:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02 19:41 shaunpatterson [this message]
2008-02-02 19:55 ` Ada Thread Termination Dmitry A. Kazakov
2008-02-02 21:23 ` gpriv
2008-02-04 17:57 ` Adam Beneschan
2008-02-04 23:26   ` Robert A Duff
replies disabled

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