Lines Matching refs:cnt
30 static void atomic_inc(int *cnt) in atomic_inc() argument
32 __atomic_add_fetch(cnt, 1, __ATOMIC_SEQ_CST); in atomic_inc()
35 static int atomic_xchg(int *cnt, int val) in atomic_xchg() argument
37 return __atomic_exchange_n(cnt, val, __ATOMIC_SEQ_CST); in atomic_xchg()
89 int err, cnt, rb_fd; in test_ringbuf() local
183 cnt = atomic_xchg(&sample_cnt, 0); in test_ringbuf()
184 CHECK(cnt != 2, "cnt", "exp %d samples, got %d\n", 2, cnt); in test_ringbuf()
190 cnt = atomic_xchg(&sample_cnt, 0); in test_ringbuf()
191 CHECK(cnt != 0, "cnt", "exp %d samples, got %d\n", 0, cnt); in test_ringbuf()
207 cnt = atomic_xchg(&sample_cnt, 0); in test_ringbuf()
208 CHECK(cnt != 2, "cnt", "exp %d samples, got %d\n", 2, cnt); in test_ringbuf()
237 cnt = atomic_xchg(&sample_cnt, 0); in test_ringbuf()
238 CHECK(cnt != 0, "cnt", "exp %d samples, got %d\n", 0, cnt); in test_ringbuf()
254 cnt = atomic_xchg(&sample_cnt, 0); in test_ringbuf()
255 CHECK(cnt != 0, "cnt", "exp %d samples, got %d\n", 0, cnt); in test_ringbuf()
284 cnt = atomic_xchg(&sample_cnt, 0); in test_ringbuf()
285 CHECK(cnt != 6, "cnt", "exp %d samples, got %d\n", 6, cnt); in test_ringbuf()