| 510 | } |
| 511 | |
| 512 | static bool client_start_parent_watchdog(pid_t initial_ppid) { |
| 513 | if (initial_ppid <= 1) { |
| 514 | return true; |
| 515 | } |
| 516 | static parent_watchdog_config_t client_config; |
| 517 | client_config.initial_ppid = initial_ppid; |
| 518 | client_config.kill_worker_group = false; |
| 519 | client_config.exit_on_parent_death = true; |
| 520 | cbm_thread_t watchdog; |
| 521 | if (cbm_thread_create(&watchdog, PARENT_WATCHDOG_STACK_SIZE, parent_watchdog_thread, |
| 522 | &client_config) != 0) { |
| 523 | return false; |
| 524 | } |
| 525 | if (cbm_thread_detach(&watchdog) != 0) { |
| 526 | atomic_store(&g_shutdown, 1); |
| 527 | (void)cbm_thread_join(&watchdog); |
| 528 | return false; |
| 529 | } |
| 530 | return true; |
| 531 | } |
| 532 | #endif |
| 533 | |
| 534 | /* ── CLI mode ───────────────────────────────────────────────────── */ |
no test coverage detected