In FORK, flush output ports inside the narrowed section, not before,
avoiding some, erm, pretty obvious race condition.
This commit is contained in:
parent
a51ba12623
commit
1e1d44a497
|
@ -1065,7 +1065,6 @@
|
||||||
;;; Assumes niladic primitive %%FORK.
|
;;; Assumes niladic primitive %%FORK.
|
||||||
|
|
||||||
(define (fork . stuff)
|
(define (fork . stuff)
|
||||||
(flush-all-ports)
|
|
||||||
(apply fork-1 #t stuff))
|
(apply fork-1 #t stuff))
|
||||||
|
|
||||||
(define (%fork . stuff)
|
(define (%fork . stuff)
|
||||||
|
@ -1104,6 +1103,10 @@
|
||||||
(lambda (thunk) (thunk)))))
|
(lambda (thunk) (thunk)))))
|
||||||
(maybe-narrow
|
(maybe-narrow
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
||||||
|
(if clear-interactive?
|
||||||
|
(flush-all-ports))
|
||||||
|
|
||||||
;; There was an atomicity problem/race condition -- if a child
|
;; There was an atomicity problem/race condition -- if a child
|
||||||
;; process died after it was forked, but before the scsh fork
|
;; process died after it was forked, but before the scsh fork
|
||||||
;; procedure could register the child's procobj in the
|
;; procedure could register the child's procobj in the
|
||||||
|
|
Loading…
Reference in New Issue