| 813 | } |
| 814 | |
| 815 | bool cbm_daemon_should_exit(cbm_daemon_coordinator_t *coordinator, uint64_t now_ms) { |
| 816 | (void)now_ms; |
| 817 | if (!coordinator) { |
| 818 | return false; |
| 819 | } |
| 820 | cbm_mutex_lock(&coordinator->mutex); |
| 821 | bool should_exit = coordinator->state == CBM_DAEMON_COORDINATOR_STOPPING && |
| 822 | coordinator->client_count == 0 && coordinator->job_count == 0 && |
| 823 | coordinator->watch_count == 0 && coordinator->callback_count == 0; |
| 824 | cbm_mutex_unlock(&coordinator->mutex); |
| 825 | return should_exit; |
| 826 | } |
| 827 | |
| 828 | bool cbm_daemon_frame_header_encode(uint8_t header[CBM_DAEMON_FRAME_HEADER_SIZE], |
| 829 | cbm_daemon_frame_type_t type, uint16_t flags, uint32_t length) { |
no test coverage detected