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

Function diag_wait_for_interval

src/foundation/diagnostics.c:468–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466}
467
468static void diag_wait_for_interval(void) {
469 uint64_t deadline = cbm_now_ms() + DIAG_INTERVAL_MS;
470 while (!atomic_load_explicit(&g_diag_stop, memory_order_acquire)) {
471 uint64_t now = cbm_now_ms();
472 if (now >= deadline) {
473 return;
474 }
475 uint64_t remaining = deadline - now;
476 unsigned int slice =
477 remaining < DIAG_WAIT_SLICE_MS ? (unsigned int)remaining : DIAG_WAIT_SLICE_MS;
478 diag_sleep_ms(slice > 0 ? slice : 1);
479 }
480}
481
482#ifdef CBM_DIAGNOSTICS_ENABLE_TEST_API
483static void diag_test_pause_writer(void) {

Callers 1

diag_thread_fnFunction · 0.85

Calls 2

cbm_now_msFunction · 0.85
diag_sleep_msFunction · 0.85

Tested by

no test coverage detected