Lines Matching refs:atomic
7 maintainers on how to implement atomic counter, bitops, and spinlock
35 The initializer is atomic in that the return values of the atomic operations
56 The setting is atomic in that the return values of the atomic operations by
67 The read is atomic in that the return value is guaranteed to be one of the
174 locks, or atomic operations if variable a can change at runtime!
178 Now, we move onto the atomic operation interfaces typically implemented with
207 and after the atomic operation calls are strongly ordered with respect
208 to the atomic operation itself.
211 before and after the atomic operation.
213 If the atomic instructions used in an implementation provide explicit
233 given atomic counter. They return a boolean indicating whether the
237 the atomic operation.
247 The given increment is added to the given atomic counter value. A boolean
256 This performs an atomic exchange operation on the atomic variable v, setting
257 the given new value. It returns the old value that the atomic variable v had
264 This performs an atomic compare exchange operation on the atomic value v,
278 If the atomic value v is not equal to u, this function adds a to v, and
280 an atomic operation.
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
314 kernel. It is the use of atomic counters to implement reference
380 before the atomic counter decrement is performed.
415 on, and that lock protects the atomic operation. Parisc uses the
421 We will now cover the atomic bitmask operations. You will find that
425 Native atomic bit operations are defined to operate on objects aligned
445 indicates whether the changed bit was set _BEFORE_ the atomic bit
464 All memory operations before the atomic bit operation call must be
465 made visible globally before the atomic bit operation is made visible.
466 Likewise, the atomic bit operation must be visible globally before any
475 "obj->dead = 1;" is visible to cpus before the atomic memory operation
476 done by test_and_set_bit() becomes visible. Likewise, the atomic
518 The __clear_bit_unlock version is non-atomic, however it still implements
522 Finally, there are non-atomic versions of the bitmask operations
525 expensive non-atomic operations may be used in the implementation.
536 These non-atomic variants also do not require any special memory
540 memory-barrier semantics as the atomic and bit operations returning
557 int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
570 an abstract atomic operation:
580 As an example usage, here is what an atomic counter update
599 int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
606 old = atomic_read(atomic);
612 ret = cas(atomic, old, new);