Revision: 23368 http://trac.macosforge.org/projects/launchd/changeset/23368 Author: zarzycki@apple.com Date: 2007-09-10 13:43:52 -0700 (Mon, 10 Sep 2007) Log Message: ----------- We only need/want the "Still alive" check if launchd has been idle for a while... Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2007-09-10 20:41:56 UTC (rev 23367) +++ trunk/launchd/src/launchd_core_logic.c 2007-09-10 20:43:52 UTC (rev 23368) @@ -639,6 +639,14 @@ return r; } +static void +still_alive_with_check(void) +{ + jobmgr_log(root_jobmgr, LOG_NOTICE, "Still alive with %u children.", total_children); + + runtime_closelog(); /* hack to flush logs */ +} + jobmgr_t jobmgr_shutdown(jobmgr_t jm) { @@ -662,7 +670,7 @@ } if (debug_shutdown_hangs && jm->parentmgr == NULL && getpid() == 1) { - jobmgr_assumes(jm, kevent_mod((uintptr_t)jm, EVFILT_TIMER, EV_ADD, NOTE_SECONDS, 3, jm) != -1); + runtime_set_timeout(still_alive_with_check, 3000); } return jobmgr_do_garbage_collection(jm); @@ -2241,11 +2249,8 @@ jobmgr_dispatch_all_semaphores(jm); break; case EVFILT_TIMER: - if (kev->ident == (uintptr_t)&sorted_calendar_events) { + if (jobmgr_assumes(jm, kev->ident == (uintptr_t)&sorted_calendar_events)) { calendarinterval_callback(); - } else { - jobmgr_log(jm, LOG_NOTICE, "Still alive with %u children.", total_children); - runtime_closelog(); /* hack to flush logs */ } break; default:
participants (1)
-
source_changes@macosforge.org