Skip to content

Commit 399618a

Browse files
terminusKernel Patches Daemon
authored andcommitted
atomic: Add atomic_cond_read_*_timeout()
Add atomic load wrappers, atomic_cond_read_*_timeout() and atomic64_cond_read_*_timeout() for the cond-load timeout interfaces. Cc: Will Deacon <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Boqun Feng <[email protected]> Signed-off-by: Ankur Arora <[email protected]>
1 parent b83c204 commit 399618a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/linux/atomic.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
#define atomic64_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c))
3232
#define atomic64_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c))
3333

34+
#define atomic_cond_read_acquire_timeout(v, c, t) \
35+
smp_cond_load_acquire_timeout(&(v)->counter, (c), (t))
36+
#define atomic_cond_read_relaxed_timeout(v, c, t) \
37+
smp_cond_load_relaxed_timeout(&(v)->counter, (c), (t))
38+
39+
#define atomic64_cond_read_acquire_timeout(v, c, t) \
40+
smp_cond_load_acquire_timeout(&(v)->counter, (c), (t))
41+
#define atomic64_cond_read_relaxed_timeout(v, c, t) \
42+
smp_cond_load_relaxed_timeout(&(v)->counter, (c), (t))
43+
3444
/*
3545
* The idea here is to build acquire/release variants by adding explicit
3646
* barriers on top of the relaxed variant. In the case where the relaxed

0 commit comments

Comments
 (0)