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

Function runtime_worker_reap_application

src/daemon/runtime.c:1312–1329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1310}
1311
1312static 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
1331static bool runtime_worker_handle_application(cbm_daemon_runtime_worker_t *worker,
1332 const uint8_t *payload, uint32_t length) {

Callers 2

runtime_worker_finishFunction · 0.85

Calls 1

cbm_thread_joinFunction · 0.85

Tested by

no test coverage detected