Lines Matching defs:counter
38 #define ATOMIC_INIT(x) { .counter = (x) }
41 volatile int counter;
62 return i + atomic_fetchadd_int(&v->counter, i);
68 return atomic_fetchadd_int(&v->counter, -i) - i;
74 atomic_store_rel_int(&v->counter, i);
80 atomic_set_int(&v->counter, mask);
86 return atomic_load_acq_int(&v->counter);
92 return atomic_fetchadd_int(&v->counter, 1) + 1;
98 return atomic_fetchadd_int(&v->counter, -1) - 1;
110 if (likely(atomic_cmpset_int(&v->counter, c, c + a)))
119 atomic_clear_int(&v->counter, mask);
127 return (atomic_swap_int(&v->counter, i));
131 ret = atomic_load_acq_int(&v->counter);
132 if (atomic_cmpset_int(&v->counter, ret, i))
145 if (atomic_cmpset_int(&v->counter, old, new))
147 ret = atomic_load_acq_int(&v->counter);
185 c = v->counter; \