comp.lang.ada
 help / color / mirror / Atom feed
* Re: abort task on WinNT
  2000-09-13 11:56 abort task on WinNT Alfred Hilscher
@ 2000-09-13  0:00 ` Robert A Duff
  0 siblings, 0 replies; 2+ messages in thread
From: Robert A Duff @ 2000-09-13  0:00 UTC (permalink / raw)


Alfred Hilscher <Alfred.Hilscher@icn.siemens.de> writes:

> The problem I have is, the program must terminate immediately when the
> user request termination. But due to the task running in a loop, it
> doesn't (it waits for the task termination I think). I tried to insert
> an "abort t;" at the end of "p", but it still doesn't terminate.

You should look at RM-9.8(15-19) and D.6(2).  You should find out
whether your compiler supports Annex D.

You can kill the whole program by aborting the environment task.  To get
the ID of the env task, declare a constant in a library package (or in
the main procedure) initialized to Current_Task.  See C.7.1.

Are you sure you want to stop the program "immediately"?
What if it's in the middle of doing something important?

- Bob




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

* abort task on WinNT
@ 2000-09-13 11:56 Alfred Hilscher
  2000-09-13  0:00 ` Robert A Duff
  0 siblings, 1 reply; 2+ messages in thread
From: Alfred Hilscher @ 2000-09-13 11:56 UTC (permalink / raw)


Hello,

I have a program consisting of a main procedure, handling user-input and
a local, free-running task. It looks like follows (schematic):

procedure p is
  task t is
  end t;

  task body t is
  begin
    loop
      null;
    end loop;
  end t;
begin
  null;
end p;

The problem I have is, the program must terminate immediately when the
user request termination. But due to the task running in a loop, it
doesn't (it waits for the task termination I think). I tried to insert
an "abort t;" at the end of "p", but it still doesn't terminate. In the
final solution, task t shall do remote communication (via serial or
TCP/IP). So maybe it waits for data transmission and will not be ready
for a rendevzous saying "shutdown". 
So my question is: how can I force immediate programm termination ?

I work on Windows NT 4.0



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

end of thread, other threads:[~2000-09-13 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-13 11:56 abort task on WinNT Alfred Hilscher
2000-09-13  0:00 ` Robert A Duff

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