comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Smeets <VSmeets@meppen.sema.slb.com>
Subject: Abort of C-code in a asynchronous_select
Date: Tue, 04 Dec 2001 15:00:55 +0100
Date: 2001-12-04T15:00:55+01:00	[thread overview]
Message-ID: <3C0CD717.F720A1DB@meppen.sema.slb.com> (raw)

Hallo,

I have a driver for reading and writing data written in C. The
C-routines are protected with a semaphores against being called by two
threads at the same time. The code can't be changed.

I want to call the blocking C-Driver.Read routine from Ada but must be
able to abort the call in case of an application state change. I was
thinking of the statements:

select
   State.Not_Active;
then abort
   C_Driver.Read (Data, Data_Last);
end select;

I am assuming that in case the Read-call is aborted, the semaphore in C
isn't freed because C doesn't know anything about the Ada-abort. Am I
correct and how can I do it better?

-- 
Vincent Smeets
SchlumbergerSema -
Competence Center Informatik GmbH 
Lohberg 10 - 49716 Meppen - Germany
tel:  +49 5931-805-461
fax:  +49 5931-805-175
mail: VSmeets@slb.com
web:  www.cci.de



             reply	other threads:[~2001-12-04 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-04 14:00 Vincent Smeets [this message]
2001-12-04 15:17 ` Abort of C-code in a asynchronous_select Thierry Lelegard
2001-12-05  3:31   ` Robert Dewar
2001-12-05  6:15   ` Vincent Smeets
2001-12-05  8:59     ` Thierry Lelegard
replies disabled

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