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

Function cli_progress_race_worker

tests/test_cli.c:111–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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