Aha! So (sleep 0) did nothing, but interestingly (sleep 1) did -- but it
didn't sleep 1!
So if I write this as
(let ((sigcalled #f))
(with-sigaction
SIGALRM (lambda (sig) (set! sigcalled #t)) #f
(lambda () (raise SIGALRM) (sleep 1)))
(assert sigcalled "we s
Higher-level question:
As these are asynchronous, (alarm 10) could actually set off the alarm at
any time after ten seconds. Is it still possible to write with-timeout?
(define (with-timeout t thunk . handler)
(let ((time-left (alarm 0));;time left on an outer alarm
(st