Skip to content

Commit 3fabacb

Browse files
committed
Fix broken initialization arguments on TruffleRuby
The `make_synchronized_on_rbx` method is used to intercept the `.new` method on Array/Hash/Set but it broke whenever the `.new` was being used with arguments. (This was shown by the Array/Hash/Set specs that were added in the previous commits being broken on TruffleRuby.)
1 parent 9be3236 commit 3fabacb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/concurrent/thread_safe/util/array_hash_rbx.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ def _mon_initialize
1010
@_monitor = Monitor.new unless @_monitor # avoid double initialisation
1111
end
1212

13-
def self.new
14-
obj = super
15-
obj.send(:_mon_initialize)
16-
obj
13+
def initialize(*args)
14+
_mon_initialize
15+
super
1716
end
1817
end
1918

0 commit comments

Comments
 (0)