original commit: 769f165ed3b876c5b6cef0f717207423d5a5cc79
This commit is contained in:
Matthew Flatt 2003-03-06 23:10:29 +00:00
parent 81189c3f16
commit b28c5d5ded

View File

@ -58,9 +58,11 @@
void
(lambda ()
(with-handlers ([exn:break? void])
(ready-for-break)
(copy-port cin in)))
(lambda () (close-output-port in)))))])
(ready-for-break #t)
(copy-port cin in)
(ready-for-break #f)))
(lambda () (close-output-port in)))
(ready-for-break #t)))])
(and get-thread? t))
in))
@ -124,7 +126,10 @@
(if-stream-out cerr)
exe args)])
(let ([ot (streamify-out cout out #t)]
[it (streamify-in cin in #t (lambda () (semaphore-post it-ready)))]
[it (streamify-in cin in #t (lambda (ok?)
(if ok?
(semaphore-post it-ready)
(semaphore-wait it-ready))))]
[et (streamify-out cerr err #t)])
(subprocess-wait subp)
(when it
@ -135,7 +140,13 @@
(when (thread? ot)
(thread-wait ot))
(when (thread? et)
(thread-wait et)))
(thread-wait et))
(when err
(close-input-port err))
(when out
(close-input-port out))
(when in
(close-output-port in)))
(zero? (subprocess-status subp))))))
(define (system str)