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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2dd7b69b3c782182 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news.wiretrip.org!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Catching Ctrl-C SIGINT Date: 17 Jan 2005 21:37:16 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1105997881 27838 62.49.19.209 (17 Jan 2005 21:38:01 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Mon, 17 Jan 2005 21:38:01 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: g2news1.google.com comp.lang.ada:7880 Date: 2005-01-17T21:37:16+00:00 List-Id: Christopher Broeg writes: > protected body Catch_Interrupt is > procedure Clean_up is > begin > Put_line("Interrupt SIGINT caught. sending signal "); > Signal_public; > Put_line("SIGNAL SENT. "); > end Clean_Up; > end Catch_Interrupt; I suspect that an interrupt handler isn't allowed to call an entry of a PO? (gdb) b exception Breakpoint 1 at 0x8059012: file a-except.adb, line 1306. (gdb) handle SIGINT pass SIGINT is used by the debugger. Are you sure you want to change it? (y or n) y Signal Stop Print Pass to program Description SIGINT Yes Yes Yes Interrupt (gdb) run Starting program: /home/simon/tmp/broeg/test1 [New Thread 1024 (LWP 4260)] [New Thread 2049 (LWP 4261)] [New Thread 1026 (LWP 4262)] [New Thread 2051 (LWP 4263)] [New Thread 3076 (LWP 4264)] 1 2 3 Program received signal SIGINT, Interrupt. [Switching to Thread 2051 (LWP 4263)] 0x400656b2 in sigsuspend () from /lib/libc.so.6 Current language: auto; currently c (gdb) c Continuing. 4Interrupt SIGINT caught. sending signal Breakpoint 1, PROGRAM_ERROR at 0x0804ab66 in (<_object>=@0x806f38c) at catch_interrupt.adb:27 27 procedure Signal is Current language: auto; currently ada (gdb) bt #0 <__gnat_raise_nodefer_with_msg> (e=0x806b494) at a-except.adb:1306 #1 0x0805934b in ada.exceptions.raise_with_msg (e=0x806b494, setup=1) at a-except.adb:1480 #2 0x080591bb in <__gnat_raise_exception> (e=0x806b494, message=0x806871c) at a-except.adb:1348 #3 0x08055b2e in system__tasking__protected_objects__entries__lock_entries () #4 0x0804ab66 in (<_object>=@0x806f38c) at catch_interrupt.adb:27 #5 0x0804a7e1 in catch_interrupt.signal_public () at catch_interrupt.adb:9 protected type Handling is entry Wait; procedure Trigger; pragma Interrupt_Handler (Trigger); private Ready : Boolean := False; end Handling; protected body Handling is entry Wait when Ready is begin Ready := False; end Wait; procedure Trigger is begin Ready := True; end Trigger; end Handling; -- Simon Wright 100% Ada, no bugs.