﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1127	dynamic wind in its own thread	kristianlm		"I'm running this code in 4.9.0rc1:

(define (trick)
  (dynamic-wind (lambda () (print ""before""))
                (lambda () (error 'foo))
                (lambda () (print ""after""))))

;; calls before and after, no surprises:
(trick)

;; calls before only - why?
(thread-start! (lambda () (trick)))

;; calls before and after, no surprises
(thread-start!
 (lambda () (handle-exceptions e (raise e) (trick))))

;;; It outputs:
before

Error: foo

	Call history:

	<syntax>	  (trick)
	<eval>	  (trick)
	<eval>	  [trick] (dynamic-wind (lambda () (print ""before"")) (lambda () (error (quote foo))) (lambda () (print ""after""...
	<eval>	  [trick] (print ""before"")
	<eval>	  [trick] (error (quote foo))	<--
after
#<thread: thread22>
before

Warning (#<thread: thread22>): in thread: foo

	Call history:

	<eval>	  (trick)
	<eval>	  [trick] (dynamic-wind (lambda () (print ""before"")) (lambda () (error (quote foo))) (lambda () (print ""after""...
	<eval>	  [trick] (print ""before"")
	<eval>	  [trick] (error (quote foo))	<--

;; I expect to see ""after"" printed on the second run too"	defect	closed	major	someday	unknown	4.9.x	invalid			
