﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1067	Variable set! in signal handler is optimised away in other code.	andyjpb		"In a module I have

{{{
(define keep-going ""yes"") ; #t seems to cause the (if keep-going ...) check to get optimised away.

...

(define (shutdown #!optional signum)
 (debug! ""Proclaim got signal ~A: shutting down..."" signum)
 (set! keep-going #f))

(define (handler)
  (set-signal-handler! signal/term shutdown)

...

(if keep-going
  (begin
    ...
    (loop)))

...
)
}}}


In my main program I (use ...) my module and then call handler which loops ""forever"".

As per the comment, if I use #t for the sentinel value of keep-going then the signal handler is unable to set! it to #f so the loop is never broken. If I use ""yes"" then it seems to work as expected.

I can't use a parameter because I don't know which thread the signal will be received in and the loop runs in the primordial thread.

"	defect	closed	major	4.9.0	unknown	4.8.x	invalid			
