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

Function th_http_stop_watchdog

tests/test_httpd.c:3112–3125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3110} th_http_stop_watchdog_t;
3111
3112static void *th_http_stop_watchdog(void *opaque) {
3113 th_http_stop_watchdog_t *watchdog = opaque;
3114 /* Hang detector, not a latency assertion: sized for the slowest
3115 * sanitizer/loaded-runner tail (see AGENTS.md, CI determinism). */
3116 for (int elapsed_ms = 0; elapsed_ms < 10000; elapsed_ms += 10) {
3117 if (atomic_load(&watchdog->stop_finished) ||
3118 (watchdog->operation_finished && atomic_load(watchdog->operation_finished)))
3119 return NULL;
3120 cbm_usleep(10 * 1000);
3121 }
3122 atomic_store(&watchdog->watchdog_fired, 1);
3123 (void)th_sock_shutdown(watchdog->socket);
3124 return NULL;
3125}
3126
3127typedef struct {
3128 cbm_httpd_t *listener;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected