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.
304 call are strongly ordered with respect to the atomic counter
307 atomic counter decrement.
310 implementation could legally allow the atomic counter update visible
317 counting, and it works such that once the counter falls to zero it can
382 before the atomic counter decrement is performed.
384 Otherwise, the counter could fall to zero, yet obj->active would still
407 counter decrement would not become globally visible until the
415 counter to be realized. Essentially, an array of spinlocks are
464 These routines, like the atomic_t counter operations returning values,
565 Atomically decrement the given counter, and if will drop to zero
567 of the counter to zero. If it does not drop to zero, do nothing
586 As an example usage, here is what an atomic counter update
589 void example_atomic_inc(long *counter)
594 old = *counter;
597 ret = cas(counter, old, new);
635 a counter dropping to zero is never made visible before the
638 Note that this also means that for the case where the counter