diff --git a/src/mzscheme/src/port.c b/src/mzscheme/src/port.c index 190a2cd1c3..bea8dd121d 100644 --- a/src/mzscheme/src/port.c +++ b/src/mzscheme/src/port.c @@ -6483,10 +6483,10 @@ static void init_sigchld(void) } } -int scheme_check_child_done() +static void check_child_done() { pid_t result; - int status, did_one = 0; + int status; System_Child *sc, *prev; if (scheme_system_children) { @@ -6511,15 +6511,11 @@ int scheme_check_child_done() prev->next = sc->next; } else scheme_system_children = sc->next; - - did_one = 1; } } } } while (result > 0); } - - return did_one; } #endif @@ -6679,6 +6675,7 @@ static int subp_done(Scheme_Object *sp) #if defined(UNIX_PROCESSES) System_Child *sc = (System_Child *)sci; + check_child_done(); return sc->done; #endif #ifdef WINDOWS_PROCESSES @@ -6717,6 +6714,8 @@ static Scheme_Object *subprocess_status(int argc, Scheme_Object **argv) #if defined(UNIX_PROCESSES) System_Child *sc = (System_Child *)sp->handle; + check_child_done(); + if (sc->done) status = sc->status; else @@ -6789,6 +6788,8 @@ static Scheme_Object *subprocess_kill(int argc, Scheme_Object **argv) { System_Child *sc = (System_Child *)sp->handle; + check_child_done(); + while (1) { if (sc->done) return scheme_void; diff --git a/src/mzscheme/src/thread.c b/src/mzscheme/src/thread.c index caedd074cf..9ee76d7270 100644 --- a/src/mzscheme/src/thread.c +++ b/src/mzscheme/src/thread.c @@ -95,10 +95,6 @@ extern HANDLE scheme_break_semaphore; #include "schfd.h" -#if defined(UNIX_PROCESSES) -extern int scheme_check_child_done(); -#endif - #define DEFAULT_INIT_STACK_SIZE 1000 #define MAX_INIT_STACK_SIZE 100000 @@ -3458,11 +3454,6 @@ static int check_sleep(int need_activity, int sleep_now) if (needs_sleep_cancelled) return 0; -#if defined(UNIX_PROCESSES) - if (scheme_check_child_done()) - return 0; -# endif - if (post_system_idle()) { return 0; } @@ -3859,10 +3850,6 @@ void scheme_thread_block(float sleep_time) /* Check scheduled_kills early and often. */ check_scheduled_kills(); -#if defined(UNIX_PROCESSES) - scheme_check_child_done(); -#endif - if (!do_atomic && (sleep_end >= 0.0)) { double msecs = 0.0;