diff options
Diffstat (limited to 'src/comp.c')
-rw-r--r-- | src/comp.c | 32 |
1 files changed, 6 insertions, 26 deletions
@@ -358,31 +358,15 @@ prog_is_leftover (struct prog *prog) return IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp); } -/* If PROG is a leftover, gracefully stop it and mark as disabled */ +/* If PROG is a leftover, mark it for termination */ static int -cb_terminate_prog (struct prog *prog, void *data) +mark_prog (struct prog *prog, void *data) { if (prog_is_leftover (prog)) - progman_stop_component (&prog); + prog->v.p.stop = 1; return 0; } -/* If PROG is a leftover, slay it with SIGKILL */ -static int -cb_kill_prog (struct prog *prog, void *data) -{ - if (prog_is_leftover (prog)) - prog_stop (prog, SIGKILL); - return 0; -} - -static int -list_is_empty (void *p) -{ - struct complist *list = p; - return list->head == NULL; -} - static int list_str_cmp (const void *a, const void *b) { @@ -504,16 +488,12 @@ component_config_commit (void) comp->arridx = i; } - /* Terminate orphaned progs */ + /* Mark orphaned progs for termination */ list = &comp_list[prev]; if (list->head) { - progman_foreach (cb_terminate_prog, NULL); - if (progman_wait_until (list_is_empty, list)) - { - progman_foreach (cb_kill_prog, NULL); - progman_wait_until (list_is_empty, list); - } + progman_foreach (mark_prog, NULL); + pies_schedule_children (PIES_CHLD_GC); } /* Build dependency map */ |