| 791 | } |
| 792 | |
| 793 | bool cbm_daemon_should_exit(cbm_daemon_coordinator_t *coordinator, uint64_t now_ms) { |
| 794 | (void)now_ms; |
| 795 | if (!coordinator) { |
| 796 | return false; |
| 797 | } |
| 798 | cbm_mutex_lock(&coordinator->mutex); |
| 799 | bool should_exit = coordinator->state == CBM_DAEMON_COORDINATOR_STOPPING && |
| 800 | coordinator->client_count == 0 && coordinator->job_count == 0 && |
| 801 | coordinator->watch_count == 0 && coordinator->callback_count == 0; |
| 802 | cbm_mutex_unlock(&coordinator->mutex); |
| 803 | return should_exit; |
| 804 | } |
| 805 | |
| 806 | bool cbm_daemon_frame_header_encode(uint8_t header[CBM_DAEMON_FRAME_HEADER_SIZE], |
| 807 | cbm_daemon_frame_type_t type, uint16_t flags, uint32_t length) { |
no test coverage detected