From 8f234fc733da2f6bba998f1f962415ead2e96275 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Wed, 26 Apr 2006 09:44:26 +0000 Subject: [PATCH] If a fork narrows the thread system to the current thread, the REPL gets suspended. However, in an interactive session, the REPL is very likely to hold the lock of the input port. Hence, release the locks of the command ports in the child if NARROW? is true. --- scsh/scsh.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scsh/scsh.scm b/scsh/scsh.scm index 22453a6..604a471 100644 --- a/scsh/scsh.scm +++ b/scsh/scsh.scm @@ -1135,6 +1135,14 @@ (if (zero? pid) ;; Child (lambda () ; Do all this outside the WITH-INTERRUPTS. + (if narrow? + (begin + ;; ugly kludge: + ;; the REPL thread is not running any more, + ;; hence unlock its command ports + (release-port-lock (command-input)) + (release-port-lock (command-output)) + (release-port-lock (command-error-output)))) ;; There is no session if parent was started in batch-mode (if (and (session-started?) clear-interactive?) (set-batch-mode?! #t)) ; Children are non-interactive.