@@ -47,11 +47,7 @@ def compare_and_set(expected_val, new_val, expected_mark, new_mark)
4747
4848 prospect = ImmutableArray [ new_val , new_mark ]
4949
50- # If we guarantee internally that `current` will never be a Numeric, we
51- # can skip a type check in `compare_and_set` and directly call
52- # `_compare_and_set`. This is possible since we always internally wrap
53- # the users `value` and `mark` in an ImmutableArray.
54- @Reference . _compare_and_set current , prospect
50+ @Reference . compare_and_set current , prospect
5551 end
5652 alias_method :compare_and_swap , :compare_and_set
5753
@@ -119,7 +115,7 @@ def update
119115 end
120116 end
121117
122- # @!macro [attach] atomic_markable_reference_method_try_update
118+ # @!macro [attach] atomic_markable_reference_method_try_update!
123119 #
124120 # Pass the current value to the given block, replacing it
125121 # with the block's result. Raise an exception if the update
@@ -133,7 +129,7 @@ def update
133129 # @return [ImmutableArray] the new value and marked state
134130 #
135131 # @raise [Concurrent::ConcurrentUpdateError] if the update fails
136- def try_update
132+ def try_update!
137133 old_val , old_mark = @Reference . get
138134 new_val , new_mark = yield old_val , old_mark
139135
@@ -147,7 +143,7 @@ def try_update
147143 ImmutableArray [ new_val , new_mark ]
148144 end
149145
150- # @!macro [attach] atomic_markable_reference_method_try_update_no_exception
146+ # @!macro [attach] atomic_markable_reference_method_try_update
151147 #
152148 # Pass the current value to the given block, replacing it with the
153149 # block's result. Simply return nil if update fails.
@@ -159,7 +155,7 @@ def try_update
159155 #
160156 # @return [ImmutableArray] the new value and marked state, or nil if
161157 # the update failed
162- def try_update_no_exception
158+ def try_update
163159 old_val , old_mark = @Reference . get
164160 new_val , new_mark = yield old_val , old_mark
165161
0 commit comments