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

Function pthread_worker_counted

src/pipeline/worker_pool.c:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49} wp_counted_arg_t;
50
51static void *pthread_worker_counted(void *arg) {
52 wp_counted_arg_t *ca = arg;
53 pthread_worker_arg_t *wa = ca->wa;
54 uint64_t ops_before = cbm_memev_thread_ops();
55 while (WP_TRUE) {
56 int idx = atomic_fetch_add_explicit(wa->next_idx, WP_STEP, memory_order_relaxed);
57 if (idx >= wa->count) {
58 break;
59 }
60 wa->fn(idx, wa->ctx);
61 ca->done++;
62 }
63 ca->ops = cbm_memev_thread_ops() - ops_before;
64 cbm_mem_class_flush_thread();
65 return NULL;
66}
67#endif
68
69static void *pthread_worker(void *arg) {

Callers

nothing calls this directly

Calls 2

cbm_memev_thread_opsFunction · 0.85

Tested by

no test coverage detected