aboutsummaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/comp.c b/src/comp.c
index 6a0e4ba..b340abe 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -358,31 +358,15 @@ prog_is_leftover (struct prog *prog)
358 return IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp); 358 return IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp);
359} 359}
360 360
361/* If PROG is a leftover, gracefully stop it and mark as disabled */ 361/* If PROG is a leftover, mark it for termination */
362static int 362static int
363cb_terminate_prog (struct prog *prog, void *data) 363mark_prog (struct prog *prog, void *data)
364{ 364{
365 if (prog_is_leftover (prog)) 365 if (prog_is_leftover (prog))
366 progman_stop_component (&prog); 366 prog->v.p.stop = 1;
367 return 0; 367 return 0;
368} 368}
369 369
370/* If PROG is a leftover, slay it with SIGKILL */
371static int
372cb_kill_prog (struct prog *prog, void *data)
373{
374 if (prog_is_leftover (prog))
375 prog_stop (prog, SIGKILL);
376 return 0;
377}
378
379static int
380list_is_empty (void *p)
381{
382 struct complist *list = p;
383 return list->head == NULL;
384}
385
386static int 370static int
387list_str_cmp (const void *a, const void *b) 371list_str_cmp (const void *a, const void *b)
388{ 372{
@@ -504,16 +488,12 @@ component_config_commit (void)
504 comp->arridx = i; 488 comp->arridx = i;
505 } 489 }
506 490
507 /* Terminate orphaned progs */ 491 /* Mark orphaned progs for termination */
508 list = &comp_list[prev]; 492 list = &comp_list[prev];
509 if (list->head) 493 if (list->head)
510 { 494 {
511 progman_foreach (cb_terminate_prog, NULL); 495 progman_foreach (mark_prog, NULL);
512 if (progman_wait_until (list_is_empty, list)) 496 pies_schedule_children (PIES_CHLD_GC);
513 {
514 progman_foreach (cb_kill_prog, NULL);
515 progman_wait_until (list_is_empty, list);
516 }
517 } 497 }
518 498
519 /* Build dependency map */ 499 /* Build dependency map */

Return to:

Send suggestions and report system problems to the System administrator.