Skip to content

Commit 48bacc4

Browse files
committed
Fix Synchronization::Object#initialize signature
1 parent 591ca92 commit 48bacc4

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

lib/concurrent/synchronization/abstract_object.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AbstractObject
2828

2929
# @abstract for helper ivar initialization if needed,
3030
# otherwise it can be left empty. It has to call ns_initialize.
31-
def initialize(*args, &block)
31+
def initialize
3232
raise NotImplementedError
3333
end
3434

lib/concurrent/synchronization/monitor_object.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Concurrent
22
module Synchronization
33
class MonitorObject < MutexObject
4-
def initialize(*args, &block)
4+
def initialize
55
@__lock__ = ::Monitor.new
66
@__condition__ = @__lock__.new_cond
77
end

lib/concurrent/synchronization/mutex_object.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Concurrent
22
module Synchronization
33
class MutexObject < AbstractObject
4-
def initialize(*args, &block)
4+
def initialize
55
@__lock__ = ::Mutex.new
66
@__condition__ = ::ConditionVariable.new
77
end

lib/concurrent/synchronization/rbx_object.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module Concurrent
22
module Synchronization
33
if Concurrent.on_rbx?
44
class RbxObject < AbstractObject
5-
def initialize(*args, &block)
6-
@waiters = []
5+
def initialize
6+
@Waiters = []
77
ensure_ivar_visibility!
88
end
99

@@ -17,29 +17,29 @@ def ns_wait(timeout = nil)
1717
wchan = Rubinius::Channel.new
1818

1919
begin
20-
@waiters.push wchan
20+
@Waiters.push wchan
2121
Rubinius.unlock(self)
2222
signaled = wchan.receive_timeout timeout
2323
ensure
2424
Rubinius.lock(self)
2525

26-
if !signaled && !@waiters.delete(wchan)
26+
if !signaled && !@Waiters.delete(wchan)
2727
# we timed out, but got signaled afterwards,
2828
# so pass that signal on to the next waiter
29-
@waiters.shift << true unless @waiters.empty?
29+
@Waiters.shift << true unless @Waiters.empty?
3030
end
3131
end
3232

3333
self
3434
end
3535

3636
def ns_signal
37-
@waiters.shift << true unless @waiters.empty?
37+
@Waiters.shift << true unless @Waiters.empty?
3838
self
3939
end
4040

4141
def ns_broadcast
42-
@waiters.shift << true until @waiters.empty?
42+
@Waiters.shift << true until @Waiters.empty?
4343
self
4444
end
4545

0 commit comments

Comments
 (0)