Lines Matching refs:counter
7 maintainers on how to implement atomic counter, bitops, and spinlock
15 typedef struct { int counter; } atomic_t;
16 typedef struct { long counter; } atomic_long_t;
18 Historically, counter has been declared volatile. This is now discouraged.
21 local_t is very similar to atomic_t. If the counter is per CPU and only
29 #define atomic_set(v, i) ((v)->counter = (i))
46 struct foo { atomic_t counter; };
54 atomic_set(&k->counter, 0);
64 #define atomic_read(v) ((v)->counter)
66 which simply reads the counter value currently visible to the calling thread.
193 atomic_t counter update in an SMP safe manner.
201 atomic_t and return the new counter value after the operation is
223 explicit counter adjustment is given instead of the implicit "1".
233 given atomic counter. They return a boolean indicating whether the
234 resulting counter value was zero or not.
247 The given increment is added to the given atomic counter value. A boolean
248 is return which indicates whether the resulting counter value is negative.
302 call are strongly ordered with respect to the atomic counter
305 atomic counter decrement.
308 implementation could legally allow the atomic counter update visible
315 counting, and it works such that once the counter falls to zero it can
380 before the atomic counter decrement is performed.
382 Otherwise, the counter could fall to zero, yet obj->active would still
405 counter decrement would not become globally visible until the
413 counter to be realized. Essentially, an array of spinlocks are
462 These routines, like the atomic_t counter operations returning values,
559 Atomically decrement the given counter, and if will drop to zero
561 of the counter to zero. If it does not drop to zero, do nothing
580 As an example usage, here is what an atomic counter update
583 void example_atomic_inc(long *counter)
588 old = *counter;
591 ret = cas(counter, old, new);
629 a counter dropping to zero is never made visible before the
632 Note that this also means that for the case where the counter