Skip to content

Commit 24a6c42

Browse files
committed
Fix an instance variable clash in Rbx
Both `Concurrent::Synchronization::RbxObject` and `Concurrent::Edge::Event` had a `@Waiters` ivar. The latter class inherits from the former, so one or the other needed to be renamed.
1 parent 17ebe0d commit 24a6c42

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/concurrent/synchronization/rbx_object.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Synchronization
77
# @!macro internal_implementation_note
88
class RbxObject < AbstractObject
99
def initialize
10-
@Waiters = []
10+
@RbxWaiters = []
1111
ensure_ivar_visibility!
1212
end
1313

@@ -21,29 +21,29 @@ def ns_wait(timeout = nil)
2121
wchan = Rubinius::Channel.new
2222

2323
begin
24-
@Waiters.push wchan
24+
@RbxWaiters.push wchan
2525
Rubinius.unlock(self)
2626
signaled = wchan.receive_timeout timeout
2727
ensure
2828
Rubinius.lock(self)
2929

30-
if !signaled && !@Waiters.delete(wchan)
30+
if !signaled && !@RbxWaiters.delete(wchan)
3131
# we timed out, but got signaled afterwards,
3232
# so pass that signal on to the next waiter
33-
@Waiters.shift << true unless @Waiters.empty?
33+
@RbxWaiters.shift << true unless @RbxWaiters.empty?
3434
end
3535
end
3636

3737
self
3838
end
3939

4040
def ns_signal
41-
@Waiters.shift << true unless @Waiters.empty?
41+
@RbxWaiters.shift << true unless @RbxWaiters.empty?
4242
self
4343
end
4444

4545
def ns_broadcast
46-
@Waiters.shift << true until @Waiters.empty?
46+
@RbxWaiters.shift << true until @RbxWaiters.empty?
4747
self
4848
end
4949

0 commit comments

Comments
 (0)