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

Function request_shutdown

src/main.c:407–416  ·  view source on GitHub ↗

Signal handlers only publish intent and close stdin. The daemon host observes * the atomic; an MCP thin client unblocks its reader and closes its authenticated * daemon connection from normal thread context. */

Source from the content-addressed store, hash-verified

405 * the atomic; an MCP thin client unblocks its reader and closes its authenticated
406 * daemon connection from normal thread context. */
407static void request_shutdown(void) {
408 if (atomic_exchange(&g_shutdown, 1)) {
409 return; /* already shutting down */
410 }
411#ifdef _WIN32
412 (void)_close(_fileno(stdin));
413#else
414 (void)close(STDIN_FILENO);
415#endif
416}
417
418static void signal_handler(int sig) {
419 (void)sig;

Callers 2

signal_handlerFunction · 0.85
parent_watchdog_threadFunction · 0.85

Calls 1

closeFunction · 0.50

Tested by

no test coverage detected