Skip to content

Commit 1227091

Browse files
aviateskpull[bot]
authored andcommitted
atomics: tweak [modify|swap]property! docs (JuliaLang#46983)
1 parent 7f8b502 commit 1227091

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

base/docs/basedocs.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2899,7 +2899,7 @@ Base.setproperty!
28992899
swapproperty!(x, f::Symbol, v, order::Symbol=:not_atomic)
29002900
29012901
The syntax `@atomic a.b, _ = c, a.b` returns `(c, swapproperty!(a, :b, c, :sequentially_consistent))`,
2902-
where there must be one getfield expression common to both sides.
2902+
where there must be one `getproperty` expression common to both sides.
29032903
29042904
See also [`swapfield!`](@ref Core.swapfield!)
29052905
and [`setproperty!`](@ref Base.setproperty!).
@@ -2909,9 +2909,9 @@ Base.swapproperty!
29092909
"""
29102910
modifyproperty!(x, f::Symbol, op, v, order::Symbol=:not_atomic)
29112911
2912-
The syntax `@atomic max(a().b, c)` returns `modifyproperty!(a(), :b,
2913-
max, c, :sequentially_consistent))`, where the first argument must be a
2914-
`getfield` expression and is modified atomically.
2912+
The syntax `@atomic op(x.f, v)` (and its equivalent `@atomic x.f op v`) returns
2913+
`modifyproperty!(x, :f, op, v, :sequentially_consistent)`, where the first argument
2914+
must be a `getproperty` expression and is modified atomically.
29152915
29162916
Invocation of `op(getproperty(x, f), v)` must return a value that can be stored in the field
29172917
`f` of the object `x` by default. In particular, unlike the default behavior of

0 commit comments

Comments
 (0)