git: 21b0a62ebcdc - stable/15 - atomic.9: fix description of acquire and release
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 09 Nov 2025 00:36:23 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=21b0a62ebcdcb5453a4d3ff824c8a827e1413e78
commit 21b0a62ebcdcb5453a4d3ff824c8a827e1413e78
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-10-05 08:39:32 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-11-09 00:35:52 +0000
atomic.9: fix description of acquire and release
(cherry picked from commit f26382dd72dfc710a8cc7159364a8166e22a4254)
---
share/man/man9/atomic.9 | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9
index c9133c6311a5..674959648330 100644
--- a/share/man/man9/atomic.9
+++ b/share/man/man9/atomic.9
@@ -182,35 +182,42 @@ This variant is the default.
The second variant has acquire semantics, and the third variant has release
semantics.
.Pp
-When an atomic operation has acquire semantics, the operation must have
+An atomic operation can only have
+.Em acquire
+semantics if it performs a load
+from memory.
+When an atomic operation has acquire semantics, a load performed as
+part of the operation must have
completed before any subsequent load or store (by program order) is
performed.
Conversely, acquire semantics do not require that prior loads or stores have
-completed before the atomic operation is performed.
-An atomic operation can only have acquire semantics if it performs a load
-from memory.
+completed before a load from the atomic operation is performed.
To denote acquire semantics, the suffix
.Dq Li _acq
is inserted into the function name immediately prior to the
.Dq Li _ Ns Aq Fa type
suffix.
-For example, to subtract two integers ensuring that the subtraction is
+For example, to subtract two integers ensuring that the load of
+the value from memory is
completed before any subsequent loads and stores are performed, use
.Fn atomic_subtract_acq_int .
.Pp
+An atomic operation can only have
+.Em release
+semantics if it performs a store to memory.
When an atomic operation has release semantics, all prior loads or stores
-(by program order) must have completed before the operation is performed.
-Conversely, release semantics do not require that the atomic operation must
+(by program order) must have completed before a store executed as part of
+the operation that is performed.
+Conversely, release semantics do not require that a store from the atomic
+operation must
have completed before any subsequent load or store is performed.
-An atomic operation can only have release semantics if it performs a store
-to memory.
To denote release semantics, the suffix
.Dq Li _rel
is inserted into the function name immediately prior to the
.Dq Li _ Ns Aq Fa type
suffix.
For example, to add two long integers ensuring that all prior loads and
-stores are completed before the addition is performed, use
+stores are completed before the store of the result is performed, use
.Fn atomic_add_rel_long .
.Pp
When a release operation by one thread