Skip to content

Commit 6ab093c

Browse files
committed
Rename to @Lock for consistency since it's a final ivar
1 parent 3720176 commit 6ab093c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class MutexAtomicBoolean
1111
# @!macro atomic_boolean_method_initialize
1212
def initialize(initial = false)
1313
super()
14-
@__Lock__ = ::Mutex.new
14+
@Lock = ::Mutex.new
1515
@value = !!initial
1616
end
1717

@@ -49,10 +49,10 @@ def make_false
4949

5050
# @!visibility private
5151
def synchronize
52-
if @__Lock__.owned?
52+
if @Lock.owned?
5353
yield
5454
else
55-
@__Lock__.synchronize { yield }
55+
@Lock.synchronize { yield }
5656
end
5757
end
5858

lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MutexAtomicFixnum
1212
# @!macro atomic_fixnum_method_initialize
1313
def initialize(initial = 0)
1414
super()
15-
@__Lock__ = ::Mutex.new
15+
@Lock = ::Mutex.new
1616
ns_set(initial)
1717
end
1818

@@ -63,10 +63,10 @@ def update
6363

6464
# @!visibility private
6565
def synchronize
66-
if @__Lock__.owned?
66+
if @Lock.owned?
6767
yield
6868
else
69-
@__Lock__.synchronize { yield }
69+
@Lock.synchronize { yield }
7070
end
7171
end
7272

lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MutexAtomicReference
1313
# @!macro atomic_reference_method_initialize
1414
def initialize(value = nil)
1515
super()
16-
@__Lock__ = ::Mutex.new
16+
@Lock = ::Mutex.new
1717
@value = value
1818
end
1919

@@ -55,10 +55,10 @@ def _compare_and_set(old_value, new_value)
5555

5656
# @!visibility private
5757
def synchronize
58-
if @__Lock__.owned?
58+
if @Lock.owned?
5959
yield
6060
else
61-
@__Lock__.synchronize { yield }
61+
@Lock.synchronize { yield }
6262
end
6363
end
6464
end

0 commit comments

Comments
 (0)