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

Function runtime_worker_reap_application

src/daemon/runtime.c:1281–1298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279}
1280
1281static bool runtime_worker_reap_application(cbm_daemon_runtime_worker_t *worker, bool wait) {
1282 if (!worker->application_thread_started) {
1283 return true;
1284 }
1285 if (!wait && !atomic_load_explicit(&worker->application_thread_done, memory_order_acquire)) {
1286 return false;
1287 }
1288 if (cbm_thread_join(&worker->application_thread) != 0) {
1289 return false;
1290 }
1291 worker->application_thread_started = false;
1292 free(worker->application_request);
1293 worker->application_request = NULL;
1294 worker->application_request_length = 0;
1295 worker->application_request_token = CBM_DAEMON_RUNTIME_APPLICATION_TOKEN_INVALID;
1296 atomic_store_explicit(&worker->application_thread_done, false, memory_order_release);
1297 return true;
1298}
1299
1300static bool runtime_worker_handle_application(cbm_daemon_runtime_worker_t *worker,
1301 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