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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,115d7688c91613a5 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Interrupt problem in GNAT Date: 1999/05/19 Message-ID: <7huup6$qoa@hobbes.crc.com>#1/1 X-Deja-AN: 479729356 References: <3742DC0D.B8F07A52@epfl.ch> Organization: Coleman Research Corporation X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Newsgroups: comp.lang.ada Date: 1999-05-19T00:00:00+00:00 List-Id: Joerg Kienzle wrote in message <3742DC0D.B8F07A52@epfl.ch>... > You did not say on which platform you are trying to do this, so I'm assuming sparc and not x86 Solaris. There is a problem with what you're trying to do. First, if you use the dynamic attach instead of the static (pragma), you will find that Interrupt 14 (Sigalrm) is reserved, and Program_Error is raised. Apparently with the static attach, it just silently fails. I have always used the dynamic attach myself, but I just tried your program with SIGTERM and SIGWINCH, by outputting a line of text in the Tick procedure. Both of those signals work with either static or dynamic attach on a SPARCstation-10 with SunOS 5.5.1, sending the signals with kill or kill -WINCH . Have you ever considered just using the facilities of Ada to do what you want? Using the package for which I have appended source code to this message (courtesy of Burns and Wellings), you can have a signal handler that pends at the entry call Wait. Then, when the signal arrives it can do its thing, and loop back to pend on the Wait call again. Meanwhile, you have a task which does nothing but loop delaying 6.0 seconds, then calling the Send entry of the signal on which your handler is pending. Just a thought -- but such an approach is much more likely to be portable. David C. Hoos, Sr. -- begin source code -- package Persistent_Signals is protected type Signal_Type is procedure Send; entry Wait; private Signal_Arrived : Boolean := False; end Signal_Type; end Persistent_Signals; package body Persistent_Signals is protected body Signal_Type is procedure Send is begin Signal_Arrived := True; end Send; entry Wait when Signal_Arrived is begin Signal_Arrived := False; end Wait; end Signal_Type; end Persistent_Signals; -- end source code --