MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / client_start_parent_watchdog

Function client_start_parent_watchdog

src/main.c:578–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578static bool client_start_parent_watchdog(pid_t initial_ppid) {
579 if (initial_ppid <= 1) {
580 return true;
581 }
582 static parent_watchdog_config_t client_config;
583 client_config.initial_ppid = initial_ppid;
584 client_config.kill_worker_group = false;
585 client_config.exit_on_parent_death = true;
586 cbm_thread_t watchdog;
587 if (cbm_thread_create(&watchdog, PARENT_WATCHDOG_STACK_SIZE, parent_watchdog_thread,
588 &client_config) != 0) {
589 return false;
590 }
591 if (cbm_thread_detach(&watchdog) != 0) {
592 atomic_store(&g_shutdown, 1);
593 (void)cbm_thread_join(&watchdog);
594 return false;
595 }
596 return true;
597}
598#else /* _WIN32 */
599/* Windows parent-death watchdog — the #914 half of the story.
600 *

Callers 1

mainFunction · 0.85

Calls 3

cbm_thread_createFunction · 0.85
cbm_thread_detachFunction · 0.85
cbm_thread_joinFunction · 0.85

Tested by

no test coverage detected