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

Function frontend_should_stop

src/daemon/frontend.c:273–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273static bool frontend_should_stop(frontend_state_t *state) {
274 cbm_mutex_lock(&state->mutex);
275 /* The input-closed leg must also require that no item is IN FLIGHT: the
276 * worker consults this while deciding whether a request failure was an
277 * expected shutdown, and the final queued item after EOF has count == 0
278 * precisely while its own forward is outstanding. Without the in_request
279 * term, any daemon-side failure of that last item was classified as an
280 * expected stop and its response silently dropped with a success exit —
281 * an unanswerable failure mode for the client. */
282 bool stopping =
283 state->stopping || (state->input_closed && state->count == 0 && !state->in_request);
284 cbm_mutex_unlock(&state->mutex);
285 return stopping;
286}
287
288static void frontend_worker_mark_done(frontend_state_t *state) {
289 cbm_mutex_lock(&state->mutex);

Callers 1

frontend_workerFunction · 0.85

Calls 2

cbm_mutex_lockFunction · 0.85
cbm_mutex_unlockFunction · 0.85

Tested by

no test coverage detected