mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
REPL server avoids thread cleanup handlers
* module/system/repl/server.scm (serve-client): Avoid thread cleanup handlers.
This commit is contained in:
parent
b85f033526
commit
94a3433b9d
1 changed files with 12 additions and 11 deletions
|
@ -133,16 +133,17 @@
|
||||||
(define (serve-client client addr)
|
(define (serve-client client addr)
|
||||||
|
|
||||||
(let ((thread (current-thread)))
|
(let ((thread (current-thread)))
|
||||||
;; Close the socket when this thread exits, even if canceled.
|
;; To shut down this thread and socket, cause it to unwind.
|
||||||
(set-thread-cleanup! thread (lambda () (close-socket! client)))
|
|
||||||
;; Arrange to cancel this thread to forcefully shut down the socket.
|
|
||||||
(add-open-socket! client (lambda () (cancel-thread thread))))
|
(add-open-socket! client (lambda () (cancel-thread thread))))
|
||||||
|
|
||||||
(with-continuation-barrier
|
(dynamic-wind
|
||||||
(lambda ()
|
(lambda () #f)
|
||||||
(parameterize ((current-input-port client)
|
(with-continuation-barrier
|
||||||
(current-output-port client)
|
(lambda ()
|
||||||
(current-error-port client)
|
(parameterize ((current-input-port client)
|
||||||
(current-warning-port client))
|
(current-output-port client)
|
||||||
(with-fluids ((*repl-stack* '()))
|
(current-error-port client)
|
||||||
(start-repl))))))
|
(current-warning-port client))
|
||||||
|
(with-fluids ((*repl-stack* '()))
|
||||||
|
(start-repl)))))
|
||||||
|
(lambda () (close-socket! client))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue