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

Function runtime_worker_commit_admission

src/daemon/runtime.c:1458–1479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1456}
1457
1458static bool runtime_worker_commit_admission(cbm_daemon_runtime_worker_t *worker) {
1459 cbm_daemon_runtime_service_t *service = worker->service;
1460 cbm_mutex_lock(&service->mutex);
1461 bool committed = service->state == CBM_DAEMON_RUNTIME_SERVICE_RUNNING && worker->admitted &&
1462 !worker->admission_committed;
1463 if (committed) {
1464 worker->admission_committed = true;
1465 service->committed_clients++;
1466 /* A freshly committed client ends any last-client linger window; the
1467 * next drop to zero re-arms it against the participants outstanding
1468 * then. */
1469 service->ephemeral_linger_deadline_ms = 0;
1470 }
1471 cbm_mutex_unlock(&service->mutex);
1472 if (committed) {
1473 /* Mirror the cleared linger onto the coordinator. client_count is
1474 * already nonzero (admission incremented it), so this only resets the
1475 * hold for the next idle window — it never retires a live coordinator. */
1476 cbm_daemon_coordinator_set_linger(service->coordinator, false);
1477 }
1478 return committed;
1479}
1480
1481static bool runtime_worker_handle_subscribe(cbm_daemon_runtime_worker_t *worker,
1482 const uint8_t *payload, uint32_t length) {

Callers 1

Calls 3

cbm_mutex_lockFunction · 0.85
cbm_mutex_unlockFunction · 0.85

Tested by

no test coverage detected