| 49 | } wp_counted_arg_t; |
| 50 | |
| 51 | static 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 | |
| 69 | static void *pthread_worker(void *arg) { |
nothing calls this directly
no test coverage detected