uatomic/x86: Remove redundant memory barriers
[urcu.git] / doc / uatomic-api.md
index 2dd63c6c76f88b332b0e00595c4e1ffab25fbb2c..642170857a1e2a4d260267c10b5dcf6892ebb5b7 100644 (file)
@@ -1,3 +1,9 @@
+<!--
+SPDX-FileCopyrightText: 2023 EfficiOS Inc.
+
+SPDX-License-Identifier: CC-BY-4.0
+-->
+
 Userspace RCU Atomic Operations API
 ===================================
 
@@ -27,7 +33,7 @@ API
 ---
 
 ```c
-void uatomic_set(type *addr, type v)
+void uatomic_set(type *addr, type v);
 ```
 
 Atomically write `v` into `addr`. By "atomically", we mean that no
@@ -36,7 +42,7 @@ effects of `uatomic_set()`.
 
 
 ```c
-type uatomic_read(type *addr)
+type uatomic_read(type *addr);
 ```
 
 Atomically read `v` from `addr`. By "atomically", we mean that
@@ -45,42 +51,43 @@ uatomic update.
 
 
 ```c
-type uatomic_cmpxchg(type *addr, type old, type new)
+type uatomic_cmpxchg(type *addr, type old, type new);
 ```
 
 An atomic read-modify-write operation that performs this
 sequence of operations atomically: check if `addr` contains `old`.
 If true, then replace the content of `addr` by `new`. Return the
-value previously contained by `addr`. This function imply a full
-memory barrier before and after the atomic operation.
+value previously contained by `addr`. This function implies a full
+memory barrier before and after the atomic operation on success.
+On failure, no memory order is guaranteed.
 
 
 ```c
-type uatomic_xchg(type *addr, type new)
+type uatomic_xchg(type *addr, type new);
 ```
 
 An atomic read-modify-write operation that performs this sequence
 of operations atomically: replace the content of `addr` by `new`,
 and return the value previously contained by `addr`. This
-function imply a full memory barrier before and after the atomic
+function implies a full memory barrier before and after the atomic
 operation.
 
 
 ```c
-type uatomic_add_return(type *addr, type v)
-type uatomic_sub_return(type *addr, type v)
+type uatomic_add_return(type *addr, type v);
+type uatomic_sub_return(type *addr, type v);
 ```
 
 An atomic read-modify-write operation that performs this
 sequence of operations atomically: increment/decrement the
 content of `addr` by `v`, and return the resulting value. This
-function imply a full memory barrier before and after the atomic
+function implies a full memory barrier before and after the atomic
 operation.
 
 
 ```c
-void uatomic_and(type *addr, type mask)
-void uatomic_or(type *addr, type mask)
+void uatomic_and(type *addr, type mask);
+void uatomic_or(type *addr, type mask);
 ```
 
 Atomically write the result of bitwise "and"/"or" between the
@@ -95,8 +102,8 @@ atomic instructions implicitly supply the needed memory barriers.
 
 
 ```c
-void uatomic_add(type *addr, type v)
-void uatomic_sub(type *addr, type v)
+void uatomic_add(type *addr, type v);
+void uatomic_sub(type *addr, type v);
 ```
 
 Atomically increment/decrement the content of `addr` by `v`.
@@ -110,8 +117,8 @@ instructions implicitly supply the needed memory barriers.
 
 
 ```c
-void uatomic_inc(type *addr)
-void uatomic_dec(type *addr)
+void uatomic_inc(type *addr);
+void uatomic_dec(type *addr);
 ```
 
 Atomically increment/decrement the content of `addr` by 1.
This page took 0.023696 seconds and 4 git commands to generate.