@@ -8,7 +8,7 @@ class AtomicMarkableReference < ::Concurrent::Synchronization::Object
8
8
# @!macro [attach] atomic_markable_reference_method_initialize
9
9
def initialize ( value = nil , mark = false )
10
10
super
11
- @reference = AtomicReference . new ImmutableArray [ value , mark ]
11
+ @Reference = AtomicReference . new ImmutableArray [ value , mark ]
12
12
ensure_ivar_visibility!
13
13
end
14
14
@@ -30,7 +30,7 @@ def initialize(value = nil, mark = false)
30
30
def compare_and_set ( expected_val , new_val , expected_mark , new_mark )
31
31
# Memoize a valid reference to the current AtomicReference for
32
32
# later comparison.
33
- current = @reference . get
33
+ current = @Reference . get
34
34
curr_val , curr_mark = current
35
35
36
36
# Ensure that that the expected values match.
@@ -44,7 +44,7 @@ def compare_and_set(expected_val, new_val, expected_mark, new_mark)
44
44
45
45
prospect = ImmutableArray [ new_val , new_mark ]
46
46
47
- @reference . compare_and_set current , prospect
47
+ @Reference . compare_and_set current , prospect
48
48
end
49
49
50
50
# @!macro [attach] atomic_markable_reference_method_get
@@ -53,7 +53,7 @@ def compare_and_set(expected_val, new_val, expected_mark, new_mark)
53
53
#
54
54
# @return [ImmutableArray] the current reference and marked values
55
55
def get
56
- @reference . get
56
+ @Reference . get
57
57
end
58
58
59
59
# @!macro [attach] atomic_markable_reference_method_value
@@ -62,7 +62,7 @@ def get
62
62
#
63
63
# @return [Object] the current value of the reference
64
64
def value
65
- @reference . get [ 0 ]
65
+ @Reference . get [ 0 ]
66
66
end
67
67
68
68
# @!macro [attach] atomic_markable_reference_method_mark
@@ -71,7 +71,7 @@ def value
71
71
#
72
72
# @return [Boolean] the current marked value
73
73
def mark
74
- @reference . get [ 1 ]
74
+ @Reference . get [ 1 ]
75
75
end
76
76
alias_method :marked? , :mark
77
77
@@ -86,7 +86,7 @@ def mark
86
86
# @return [ImmutableArray] both the new value and the new mark
87
87
def set ( new_val , new_mark )
88
88
ImmutableArray [ new_val , new_mark ] . tap do |pair |
89
- @reference . set pair
89
+ @Reference . set pair
90
90
end
91
91
end
92
92
0 commit comments