mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-11 23:17:34 +02:00
Fixing exception handlers for threadless builds.
This commit is contained in:
parent
a61cebb1e9
commit
6af5f46721
1 changed files with 16 additions and 7 deletions
|
@ -890,13 +890,22 @@
|
||||||
(define (raise-continuable exn)
|
(define (raise-continuable exn)
|
||||||
(raise (list *continuable* exn)))
|
(raise (list *continuable* exn)))
|
||||||
|
|
||||||
(define (%with-exception-handler handler thunk)
|
(cond-expand
|
||||||
(let* ((old (thread-parameters))
|
(threads
|
||||||
(new (cons (cons current-exception-handler handler) old)))
|
(define (%with-exception-handler handler thunk)
|
||||||
(dynamic-wind
|
(let* ((old (thread-parameters))
|
||||||
(lambda () (thread-parameters-set! new))
|
(new (cons (cons current-exception-handler handler) old)))
|
||||||
thunk
|
(dynamic-wind
|
||||||
(lambda () (thread-parameters-set! old)))))
|
(lambda () (thread-parameters-set! new))
|
||||||
|
thunk
|
||||||
|
(lambda () (thread-parameters-set! old))))))
|
||||||
|
(else
|
||||||
|
(define (%with-exception-handler handler thunk)
|
||||||
|
(let ((old (current-exception-handler)))
|
||||||
|
(dynamic-wind
|
||||||
|
(lambda () (current-exception-handler handler))
|
||||||
|
thunk
|
||||||
|
(lambda () (current-exception-handler old)))))))
|
||||||
|
|
||||||
(define (with-exception-handler handler thunk)
|
(define (with-exception-handler handler thunk)
|
||||||
(letrec ((orig-handler (current-exception-handler))
|
(letrec ((orig-handler (current-exception-handler))
|
||||||
|
|
Loading…
Add table
Reference in a new issue