In Racket, break-thread is used to send an break exception to a thread[1].

E. g.

(let ((th (thread (lambda ()
            (dynamic-wind
              (lambda () #t)
              (lambda () (/ 1 0))
              (lambda () (sleep 5) (display "out-guard\n")))))))

  (sleep 1)
  (break-thread th))

For above code, out-guard part of dynmaic-wind will not be interrupted if
use break-thread to cancel a thread, and kill-thread will cancel thread
immediately.

In Guile, the equivalent of kill-thread is cancel-thread, and is there any
equivalent of break-thread?

[1] http://docs.racket-lang.org/reference/breakhandler.html

Regards,
Xin Wang

Reply via email to