Re: DYNAMIC-WIND before and after procedures are not protected from interruption

Robert Ransom <[email protected]> Thu, 24 Dec 2009 10:28:57 -0800
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
On Thu, 24 Dec 2009 10:24:43 -0500
Taylor R Campbell <[email protected]> wrote:

>    Date: Thu, 24 Dec 2009 00:50:28 -0800
>    From: Robert Ransom <[email protected]>
> 
>    You don't need to interrupt that code snippet during the after thunk to
>    keep it from releasing its lock:
> 
>    > ,open debug-messages threads
>    > (define (make-print-thunk . xs) (lambda () (apply debug-message xs)))
>    ; no values returned
>    > (dynamic-wind (make-print-thunk "<in>") (lambda () (sleep 10000)) (make-print-thunk "<out>"))
>    <in>
>    ^C
>    interrupt: keyboard interrupt [command-level-event-handler]
>               keyboard
>    1> ,pop
>    <out>
>    ; no values returned
>    > 
> 
> I don't understand.  Both before and after procedures were executed,
> as the output demonstrates.  How would the lock not be released?

Sorry -- I was confused.  The lock would not have been released before
the REPL appeared, but that is to be expected.  (Also, I just tried
interrupting that expression during the call to SLEEP, and using the
reset command, and <out> appeared as I should have expected.)

Robert Ransom