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

Function diag_wait_for_interval

src/foundation/diagnostics.c:467–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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