File tree Expand file tree Collapse file tree 5 files changed +11
-9
lines changed
Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1+ require 'concurrent/atomic_reference/rbx'
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ module Synchronization
1010 MriMutexLockableObject
1111 when Concurrent . on_jruby?
1212 JRubyLockableObject
13- when Concurrent . on_rbx?
13+ when Concurrent . on_rbx? || Concurrent . on_truffle?
1414 RbxLockableObject
1515 else
1616 warn 'Possibly unsupported Ruby implementation'
Original file line number Diff line number Diff line change @@ -8,10 +8,9 @@ module Synchronization
88 MriObject
99 when Concurrent . on_jruby?
1010 JRubyObject
11- when Concurrent . on_rbx?
11+ when Concurrent . on_rbx? || Concurrent . on_truffle?
1212 RbxObject
1313 else
14- warn 'Possibly unsupported Ruby implementation'
1514 MriObject
1615 end
1716 private_constant :ObjectImplementation
Original file line number Diff line number Diff line change @@ -18,15 +18,13 @@ def synchronize(&block)
1818 if @__owner__ == Thread . current
1919 yield
2020 else
21- Rubinius . lock ( self )
22- begin
21+ result = nil
22+ Rubinius . synchronize ( self ) do
2323 @__owner__ = Thread . current
24- result = yield
25- ensure
24+ result = yield
2625 @__owner__ = nil
27- Rubinius . unlock ( self )
28- result
2926 end
27+ result
3028 end
3129 end
3230
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ def on_rbx?
1919 ruby_engine == 'rbx'
2020 end
2121
22+ def on_truffle?
23+ ruby_engine == 'jruby+truffle'
24+ end
25+
2226 def on_windows?
2327 !( RbConfig ::CONFIG [ 'host_os' ] =~ /mswin|mingw|cygwin/ ) . nil?
2428 end
You can’t perform that action at this time.
0 commit comments