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

Function runtime_worker_reap_application

src/daemon/runtime.c:1273–1290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1271}
1272
1273static bool runtime_worker_reap_application(cbm_daemon_runtime_worker_t *worker, bool wait) {
1274 if (!worker->application_thread_started) {
1275 return true;
1276 }
1277 if (!wait && !atomic_load_explicit(&worker->application_thread_done, memory_order_acquire)) {
1278 return false;
1279 }
1280 if (cbm_thread_join(&worker->application_thread) != 0) {
1281 return false;
1282 }
1283 worker->application_thread_started = false;
1284 free(worker->application_request);
1285 worker->application_request = NULL;
1286 worker->application_request_length = 0;
1287 worker->application_request_token = CBM_DAEMON_RUNTIME_APPLICATION_TOKEN_INVALID;
1288 atomic_store_explicit(&worker->application_thread_done, false, memory_order_release);
1289 return true;
1290}
1291
1292static bool runtime_worker_handle_application(cbm_daemon_runtime_worker_t *worker,
1293 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