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.
This commit is contained in:
mainzelm 2006-04-26 09:44:26 +00:00
parent 9a7d5fb8dd
commit 8f234fc733
1 changed files with 8 additions and 0 deletions

View File

@ -1135,6 +1135,14 @@
(if (zero? pid) (if (zero? pid)
;; Child ;; Child
(lambda () ; Do all this outside the WITH-INTERRUPTS. (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 ;; There is no session if parent was started in batch-mode
(if (and (session-started?) clear-interactive?) (if (and (session-started?) clear-interactive?)
(set-batch-mode?! #t)) ; Children are non-interactive. (set-batch-mode?! #t)) ; Children are non-interactive.