From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8d576fd5240da9e9,start X-Google-Attributes: gid103376,public From: davidb42@my-deja.com Subject: Are delay statements abortable? Date: 2000/01/10 Message-ID: <85buah$hn4$1@nnrp1.deja.com>#1/1 X-Deja-AN: 570623569 X-Http-Proxy: 1.0 proxy1-stl.int.csc.com.au:3128 (Squid/2.3.DEVEL3), 1.0 www-cache1.csc.com.au:3128 (Squid/2.2.STABLE5), 1.0 x39.deja.com:80 (Squid/1.1.22) for client 20.10.51.81, 20.18.1.97, 202.10.5.197 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Jan 10 06:30:41 2000 GMT X-MyDeja-Info: XMYDJUIDdavidb42 Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7C-SGI [en] (X11; I; IRIX 6.5 IP22) Date: 2000-01-10T00:00:00+00:00 List-Id: Are delay statements interruptable/abortable? I was expecting delay statements in tasks (or in the abortable part of an asynchronous select construct) to be brought to a premature end on aborting the task (or on the triggering event). However, in the Ada implementation I am using, the abortion only seems to take effect at the expiry of the delay. For example, in the program below, the main task completes after 25 seconds, but the dependent task (and thus the program as a whole) doesn't terminate until 40 seconds (at expiry of the 2nd 20 second delay). Is this right? David Bowerman CSC Australia. ************************************************************** with Text_IO; procedure Test_Abort_of_Delay is task Dependent_Task; task body Dependent_Task is begin Text_IO.Put_Line ("Starting dependent task."); delay 20.0; Text_IO.Put_Line ("20 second delay has completed."); delay 20.0; Text_IO.Put_Line ("40 second delay has completed."); delay 20.0; Text_IO.Put_Line ("60 second delay has completed."); delay 20.0; Text_IO.Put_Line ("80 second delay has completed."); Text_IO.Put_Line ("Completing dependent task."); end Dependent_Task; begin -- Main task Text_IO.Put_Line ("Starting main task."); delay 25.0; abort Dependent_Task; Text_IO.Put_Line ("Completing main task."); end Test_Abort_of_Delay; Sent via Deja.com http://www.deja.com/ Before you buy.