| 1310 | } |
| 1311 | |
| 1312 | static bool runtime_worker_reap_application(cbm_daemon_runtime_worker_t *worker, bool wait) { |
| 1313 | if (!worker->application_thread_started) { |
| 1314 | return true; |
| 1315 | } |
| 1316 | if (!wait && !atomic_load_explicit(&worker->application_thread_done, memory_order_acquire)) { |
| 1317 | return false; |
| 1318 | } |
| 1319 | if (cbm_thread_join(&worker->application_thread) != 0) { |
| 1320 | return false; |
| 1321 | } |
| 1322 | worker->application_thread_started = false; |
| 1323 | free(worker->application_request); |
| 1324 | worker->application_request = NULL; |
| 1325 | worker->application_request_length = 0; |
| 1326 | worker->application_request_token = CBM_DAEMON_RUNTIME_APPLICATION_TOKEN_INVALID; |
| 1327 | atomic_store_explicit(&worker->application_thread_done, false, memory_order_release); |
| 1328 | return true; |
| 1329 | } |
| 1330 | |
| 1331 | static bool runtime_worker_handle_application(cbm_daemon_runtime_worker_t *worker, |
| 1332 | const uint8_t *payload, uint32_t length) { |
no test coverage detected