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

Function cli_progress_race_worker

tests/test_cli.c:109–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107} cli_progress_race_arg_t;
108
109static void *cli_progress_race_worker(void *opaque) {
110 cli_progress_race_arg_t *arg = opaque;
111 char counts[128];
112 char progress[128];
113 (void)snprintf(counts, sizeof(counts), "level=info msg=gbuf.dump nodes=%d edges=%d",
114 1000 + arg->worker_id, 2000 + arg->worker_id);
115 (void)snprintf(progress, sizeof(progress),
116 "level=info msg=parallel.extract.progress done=%d total=%d", arg->worker_id + 1,
117 CLI_PROGRESS_RACE_THREADS);
118
119 while (!atomic_load_explicit(arg->start, memory_order_acquire)) {
120 cbm_usleep(100);
121 }
122 for (int round = 0; round < CLI_PROGRESS_RACE_ROUNDS; round++) {
123 cbm_progress_sink_fn(counts);
124 cbm_progress_sink_fn(progress);
125 }
126 return NULL;
127}
128
129/* A normal run checks that concurrent callback delivery remains usable. More
130 * importantly, this is the focused TSan guard for progress-sink state: all

Callers

nothing calls this directly

Calls 1

cbm_progress_sink_fnFunction · 0.85

Tested by

no test coverage detected