File tree Expand file tree Collapse file tree 6 files changed +9
-4
lines changed Expand file tree Collapse file tree 6 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class Array < ::Array
2525 include JRuby ::Synchronized
2626 end
2727
28- elsif Concurrent . on_rbx?
28+ elsif Concurrent . on_rbx? || Concurrent . on_truffle?
2929 require 'monitor'
3030 require 'concurrent/thread_safe/util/array_hash_rbx'
3131
Original file line number Diff line number Diff line change 1- require 'concurrent/atomic_reference/rbx '
1+ require 'concurrent/atomic_reference/mutex_atomic '
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class Hash < ::Hash
2222 include JRuby ::Synchronized
2323 end
2424
25- elsif Concurrent . on_rbx?
25+ elsif Concurrent . on_rbx? || Concurrent . on_truffle?
2626 require 'monitor'
2727 require 'concurrent/thread_safe/util/array_hash_rbx'
2828
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ module Collection
1818 when 'rbx'
1919 require 'concurrent/collection/map/atomic_reference_map_backend'
2020 AtomicReferenceMapBackend
21+ when 'jruby+truffle'
22+ require 'concurrent/collection/map/atomic_reference_map_backend'
23+ AtomicReferenceMapBackend
2124 else
2225 warn 'Concurrent::Map: unsupported Ruby engine, using a fully synchronized Concurrent::Map implementation' if $VERBOSE
2326 require 'concurrent/collection/map/synchronized_map_backend'
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module Synchronization
1313 when Concurrent . on_rbx?
1414 RbxLockableObject
1515 when Concurrent . on_truffle?
16- TruffleLockableObject
16+ MriMutexLockableObject
1717 else
1818 warn 'Possibly unsupported Ruby implementation'
1919 MriMonitorLockableObject
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ def physical_processor_count
7575 def compute_processor_count
7676 if Concurrent . on_jruby?
7777 java . lang . Runtime . getRuntime . availableProcessors
78+ elsif Concurrent . on_truffle?
79+ Truffle ::Primitive . logical_processors
7880 else
7981 os_name = RbConfig ::CONFIG [ "target_os" ]
8082 if os_name =~ /mingw|mswin/
You can’t perform that action at this time.
0 commit comments