diff --git a/scsh/procobj.scm b/scsh/procobj.scm index 9aa571b..37f5dd6 100644 --- a/scsh/procobj.scm +++ b/scsh/procobj.scm @@ -174,14 +174,14 @@ (define (with-autoreaping thunk) (set! *autoreap-policy* 'early) - (run-as-long-as + ((structure-ref threads-internal spawn-on-root) (lambda () (let lp ((event (most-recent-sigevent))) (let ((next-event (next-sigevent event interrupt/chld))) (*sigchld-handler*) (lp next-event)))) - thunk - 'auto-reaping)) + 'auto-reaping) + (thunk)) ;;; This list contains pids whose proc-obj were gc'd before they died ;;; We try to reap them after every gc and maybe on every SIGCHLD @@ -241,7 +241,7 @@ (obtain-lock wait-lock) (receive (pid status) (%wait-any (bitwise-ior wait/poll wait/stopped-children)) - (if pid + (if (and pid (not (status:stop-sig status))) (begin (waited-by-reap pid status) (release-lock wait-lock) ; (format (current-error-port)