[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Catching user interrupts
From: |
Marius Vollmer |
Subject: |
Re: Catching user interrupts |
Date: |
Sat, 20 Mar 2004 23:08:35 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Andy Wingo <address@hidden> writes:
> I'm running into trouble catching interrupts. It always works the first
> time, but the second time I run a piece of code in the repl it becomes
> unresponsive. For example:
>
> (catch #t
> (lambda () (while #t #t))
> (lambda (key . args)
> (if (not (eq? key 'signal))
> (apply throw key args))))
>
> Try that twice in your repl.
Strange. Try this variant
(catch #t
(lambda () (while #t #t))
(lambda (key . args)
(unmask-signals) ;;; <- this is new
(if (not (eq? key 'signal))
(apply throw key args))))
Somehow, signals end up being 'masked' after your code loop is
interrupted. I haven't yet investigated why, tho.
This problem does not occur in 1.7, which has a quite different way to
handle signals internally.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Catching user interrupts,
Marius Vollmer <=