change to automatic reaping of zombie processes started by 'subprocess'
svn: r15520
This commit is contained in:
parent
4384eb741c
commit
a68e353b99
|
@ -73,11 +73,7 @@ The @scheme[subprocess] procedure returns four values:
|
||||||
|
|
||||||
@bold{Important:} All ports returned from @scheme[subprocess] must be
|
@bold{Important:} All ports returned from @scheme[subprocess] must be
|
||||||
explicitly closed with @scheme[close-input-port] or
|
explicitly closed with @scheme[close-input-port] or
|
||||||
@scheme[close-output-port]. Similarly, waiting on the subprocess value
|
@scheme[close-output-port].
|
||||||
(using @scheme[subprocess-wait] or @scheme[sync]) ensures that the
|
|
||||||
operating system can release the subprocess; for example,
|
|
||||||
exiting without waiting on a subprocess under Unix risks leaving the
|
|
||||||
subprocess as a zombie.
|
|
||||||
|
|
||||||
The returned ports are @tech{file-stream ports} (see
|
The returned ports are @tech{file-stream ports} (see
|
||||||
@secref["file-ports"]), and they are placed into the management of
|
@secref["file-ports"]), and they are placed into the management of
|
||||||
|
|
|
@ -6814,6 +6814,8 @@ static int MyPipe(int *ph, int near_index) {
|
||||||
# define GC_write_barrier(x) /* empty */
|
# define GC_write_barrier(x) /* empty */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int need_to_check_children;
|
||||||
|
|
||||||
#ifdef MZ_XFORM
|
#ifdef MZ_XFORM
|
||||||
START_XFORM_SKIP;
|
START_XFORM_SKIP;
|
||||||
#endif
|
#endif
|
||||||
|
@ -6832,6 +6834,7 @@ void scheme_block_child_signals(int block)
|
||||||
|
|
||||||
static void child_done(int ingored)
|
static void child_done(int ingored)
|
||||||
{
|
{
|
||||||
|
need_to_check_children = 1;
|
||||||
scheme_signal_received();
|
scheme_signal_received();
|
||||||
|
|
||||||
# ifdef SIGSET_NEEDS_REINSTALL
|
# ifdef SIGSET_NEEDS_REINSTALL
|
||||||
|
@ -6896,6 +6899,14 @@ static void check_child_done()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void scheme_check_child_done(void)
|
||||||
|
{
|
||||||
|
if (need_to_check_children) {
|
||||||
|
need_to_check_children = 0;
|
||||||
|
check_child_done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
|
|
|
@ -414,6 +414,7 @@ void scheme_start_itimer_thread(long usec);
|
||||||
|
|
||||||
#ifdef UNIX_PROCESSES
|
#ifdef UNIX_PROCESSES
|
||||||
void scheme_block_child_signals(int block);
|
void scheme_block_child_signals(int block);
|
||||||
|
void scheme_check_child_done(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Scheme_Object **scheme_alloc_runstack(long len);
|
Scheme_Object **scheme_alloc_runstack(long len);
|
||||||
|
|
|
@ -4088,6 +4088,11 @@ void scheme_thread_block(float sleep_time)
|
||||||
/* Check scheduled_kills early and often. */
|
/* Check scheduled_kills early and often. */
|
||||||
check_scheduled_kills();
|
check_scheduled_kills();
|
||||||
|
|
||||||
|
#ifdef UNIX_PROCESSES
|
||||||
|
/* Reap zombie processes: */
|
||||||
|
scheme_check_child_done();
|
||||||
|
#endif
|
||||||
|
|
||||||
shrink_cust_box_array();
|
shrink_cust_box_array();
|
||||||
|
|
||||||
if (scheme_active_but_sleeping)
|
if (scheme_active_but_sleeping)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user