Skip to content

Commit

Permalink
atomics: tweak [modify|swap]property! docs (#46983)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk authored Oct 3, 2022
1 parent 9105064 commit a392e39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ Base.setproperty!
swapproperty!(x, f::Symbol, v, order::Symbol=:not_atomic)
The syntax `@atomic a.b, _ = c, a.b` returns `(c, swapproperty!(a, :b, c, :sequentially_consistent))`,
where there must be one getfield expression common to both sides.
where there must be one `getproperty` expression common to both sides.
See also [`swapfield!`](@ref Core.swapfield!)
and [`setproperty!`](@ref Base.setproperty!).
Expand All @@ -2909,9 +2909,9 @@ Base.swapproperty!
"""
modifyproperty!(x, f::Symbol, op, v, order::Symbol=:not_atomic)
The syntax `@atomic max(a().b, c)` returns `modifyproperty!(a(), :b,
max, c, :sequentially_consistent))`, where the first argument must be a
`getfield` expression and is modified atomically.
The syntax `@atomic op(x.f, v)` (and its equivalent `@atomic x.f op v`) returns
`modifyproperty!(x, :f, op, v, :sequentially_consistent)`, where the first argument
must be a `getproperty` expression and is modified atomically.
Invocation of `op(getproperty(x, f), v)` must return a value that can be stored in the field
`f` of the object `x` by default. In particular, unlike the default behavior of
Expand Down

0 comments on commit a392e39

Please sign in to comment.