Skip to content

Commit cef13b9

Browse files
committed
Update Set doc
1 parent cc54be4 commit cef13b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/concurrent/set.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ module Concurrent
1616
#
1717
# @note `a += b` is **not** a **thread-safe** operation on
1818
# `Concurrent::Set`. It reads Set `a`, then it creates new `Concurrent::Set`
19-
# which is concatenation of `a` and `b`, then it writes the concatenation to `a`.
19+
# which is union of `a` and `b`, then it writes the union to `a`.
2020
# The read and write are independent operations they do not form a single atomic
2121
# operation therefore when two `+=` operations are executed concurrently updates
22+
# may be lost. Use `#merge` instead.
23+
#
24+
# @see http://ruby-doc.org/stdlib-2.4.0/libdoc/set/rdoc/Set.html Ruby standard library `Set`
2225
class Set < ::Set;
2326
end
2427

0 commit comments

Comments
 (0)