Skip to content

Commit 3cfdb5c

Browse files
amartini51lorentey
andcommitted
The APIs from Synchronization are also atomic
Co-authored-by: Karoy Lorentey <[email protected]>
1 parent 9abe4c6 commit 3cfdb5c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

TSPL.docc/LanguageGuide/MemorySafety.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,18 @@ for example, a variable, constant, or property.
152152
The duration of a memory access
153153
is either instantaneous or long-term.
154154

155-
An operation is *atomic*
156-
if it uses only C atomic operations;
155+
An access is *atomic* if
156+
it's a call to an atomic operation on [`Atomic`] or [`AtomicLazyReference`],
157+
or it it uses only C atomic operations;
157158
otherwise it's nonatomic.
158-
For a list of those functions, see the `stdatomic(3)` man page.
159+
For a list of C atomic functions, see the `stdatomic(3)` man page.
160+
161+
[`Atomic`]: https://developer.apple.com/documentation/synchronization/atomic
162+
[`AtomicLazyReference`]: https://developer.apple.com/documentation/synchronization/atomiclazyreference
159163

160164
<!--
161-
Using these functions from Swift requires some shimming -- for example:
165+
Using the C atomic functions from Swift
166+
requires some shimming that's out of scope for TSPL - for example:
162167
https://github.com/apple/swift-se-0282-experimental/tree/master/Sources/_AtomicsShims
163168
-->
164169

0 commit comments

Comments
 (0)