Skip to content

Commit

Permalink
Documentation: Memory barrier semantics of atomic_xchg()
Browse files Browse the repository at this point in the history
Add atomic_xchg() to documentation for atomic operations and
memory barriers.

Signed-off-by: Richard Braun <rbraun@sceen.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
  • Loading branch information
Richard Braun authored and Paul E. McKenney committed Jan 8, 2013
1 parent 5249453 commit 7e8b1e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Documentation/atomic_ops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ This performs an atomic exchange operation on the atomic variable v, setting
the given new value. It returns the old value that the atomic variable v had
just before the operation.

atomic_xchg requires explicit memory barriers around the operation.

int atomic_cmpxchg(atomic_t *v, int old, int new);

This performs an atomic compare exchange operation on the atomic value v,
Expand Down
1 change: 1 addition & 0 deletions Documentation/memory-barriers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,7 @@ explicit lock operations, described later). These include:

xchg();
cmpxchg();
atomic_xchg();
atomic_cmpxchg();
atomic_inc_return();
atomic_dec_return();
Expand Down

0 comments on commit 7e8b1e7

Please sign in to comment.