Skip to content

Commit c6ae994

Browse files
committed
Removed unused macros
1 parent da6a4f0 commit c6ae994

File tree

1 file changed

+26
-45
lines changed

1 file changed

+26
-45
lines changed

lib/concurrent/atomic/atomic_markable_reference.rb

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
module Concurrent
22
module Atomic
3-
# @!macro [attach] atomic_markable_reference
3+
# An atomic reference which maintains an object reference along with a mark bit
4+
# that can be updated atomically.
45
#
5-
# An atomic reference which maintains an object reference along with a mark bit
6-
# that can be updated atomically.
7-
#
8-
# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicMarkableReference.html
9-
# java.util.concurrent.atomic.AtomicMarkableReference
6+
# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicMarkableReference.html
7+
# java.util.concurrent.atomic.AtomicMarkableReference
108
class AtomicMarkableReference < ::Concurrent::Synchronization::Object
119

1210
private(*attr_atomic(:reference))
1311

14-
# @!macro [attach] atomic_markable_reference_method_initialize
1512
def initialize(value = nil, mark = false)
1613
super()
1714
self.reference = immutable_array(value, mark)
1815
end
1916

20-
# @!macro [attach] atomic_markable_reference_method_compare_and_set
21-
#
22-
# Atomically sets the value and mark to the given updated value and
23-
# mark given both:
24-
# - the current value == the expected value &&
25-
# - the current mark == the expected mark
17+
# Atomically sets the value and mark to the given updated value and
18+
# mark given both:
19+
# - the current value == the expected value &&
20+
# - the current mark == the expected mark
2621
#
27-
# @param [Object] expected_val the expected value
28-
# @param [Object] new_val the new value
29-
# @param [Boolean] expected_mark the expected mark
30-
# @param [Boolean] new_mark the new mark
22+
# @param [Object] expected_val the expected value
23+
# @param [Object] new_val the new value
24+
# @param [Boolean] expected_mark the expected mark
25+
# @param [Boolean] new_mark the new mark
3126
#
32-
# @return [Boolean] `true` if successful. A `false` return indicates
33-
# that the actual value was not equal to the expected value or the
34-
# actual mark was not equal to the expected mark
27+
# @return [Boolean] `true` if successful. A `false` return indicates
28+
# that the actual value was not equal to the expected value or the
29+
# actual mark was not equal to the expected mark
3530
def compare_and_set(expected_val, new_val, expected_mark, new_mark)
3631
# Memoize a valid reference to the current AtomicReference for
3732
# later comparison.
@@ -59,49 +54,39 @@ def compare_and_set(expected_val, new_val, expected_mark, new_mark)
5954
end
6055
alias_method :compare_and_swap, :compare_and_set
6156

62-
# @!macro [attach] atomic_markable_reference_method_get
63-
#
64-
# Gets the current reference and marked values.
57+
# Gets the current reference and marked values.
6558
#
66-
# @return [Array] the current reference and marked values
59+
# @return [Array] the current reference and marked values
6760
def get
6861
reference
6962
end
7063

71-
# @!macro [attach] atomic_markable_reference_method_value
64+
# Gets the current value of the reference
7265
#
73-
# Gets the current value of the reference
74-
#
75-
# @return [Object] the current value of the reference
66+
# @return [Object] the current value of the reference
7667
def value
7768
reference[0]
7869
end
7970

80-
# @!macro [attach] atomic_markable_reference_method_mark
81-
#
82-
# Gets the current marked value
71+
# Gets the current marked value
8372
#
84-
# @return [Boolean] the current marked value
73+
# @return [Boolean] the current marked value
8574
def mark
8675
reference[1]
8776
end
8877
alias_method :marked?, :mark
8978

90-
# @!macro [attach] atomic_markable_reference_method_set
79+
# _Unconditionally_ sets to the given value of both the reference and
80+
# the mark.
9181
#
92-
# _Unconditionally_ sets to the given value of both the reference and
93-
# the mark.
82+
# @param [Object] new_val the new value
83+
# @param [Boolean] new_mark the new mark
9484
#
95-
# @param [Object] new_val the new value
96-
# @param [Boolean] new_mark the new mark
97-
#
98-
# @return [Array] both the new value and the new mark
85+
# @return [Array] both the new value and the new mark
9986
def set(new_val, new_mark)
10087
self.reference = immutable_array(new_val, new_mark)
10188
end
10289

103-
# @!macro [attach] atomic_markable_reference_method_update
104-
#
10590
# Pass the current value and marked state to the given block, replacing it
10691
# with the block's results. May retry if the value changes during the
10792
# block's execution.
@@ -123,8 +108,6 @@ def update
123108
end
124109
end
125110

126-
# @!macro [attach] atomic_markable_reference_method_try_update!
127-
#
128111
# Pass the current value to the given block, replacing it
129112
# with the block's result. Raise an exception if the update
130113
# fails.
@@ -151,8 +134,6 @@ def try_update!
151134
immutable_array(new_val, new_mark)
152135
end
153136

154-
# @!macro [attach] atomic_markable_reference_method_try_update
155-
#
156137
# Pass the current value to the given block, replacing it with the
157138
# block's result. Simply return nil if update fails.
158139
#

0 commit comments

Comments
 (0)