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
25
25
include JRuby ::Synchronized
26
26
end
27
27
28
- elsif Concurrent . on_rbx?
28
+ elsif Concurrent . on_rbx? || Concurrent . on_truffle?
29
29
require 'monitor'
30
30
require 'concurrent/thread_safe/util/array_hash_rbx'
31
31
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
22
22
include JRuby ::Synchronized
23
23
end
24
24
25
- elsif Concurrent . on_rbx?
25
+ elsif Concurrent . on_rbx? || Concurrent . on_truffle?
26
26
require 'monitor'
27
27
require 'concurrent/thread_safe/util/array_hash_rbx'
28
28
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ module Collection
18
18
when 'rbx'
19
19
require 'concurrent/collection/map/atomic_reference_map_backend'
20
20
AtomicReferenceMapBackend
21
+ when 'jruby+truffle'
22
+ require 'concurrent/collection/map/atomic_reference_map_backend'
23
+ AtomicReferenceMapBackend
21
24
else
22
25
warn 'Concurrent::Map: unsupported Ruby engine, using a fully synchronized Concurrent::Map implementation' if $VERBOSE
23
26
require 'concurrent/collection/map/synchronized_map_backend'
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module Synchronization
13
13
when Concurrent . on_rbx?
14
14
RbxLockableObject
15
15
when Concurrent . on_truffle?
16
- TruffleLockableObject
16
+ MriMutexLockableObject
17
17
else
18
18
warn 'Possibly unsupported Ruby implementation'
19
19
MriMonitorLockableObject
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ def physical_processor_count
75
75
def compute_processor_count
76
76
if Concurrent . on_jruby?
77
77
java . lang . Runtime . getRuntime . availableProcessors
78
+ elsif Concurrent . on_truffle?
79
+ Truffle ::Primitive . logical_processors
78
80
else
79
81
os_name = RbConfig ::CONFIG [ "target_os" ]
80
82
if os_name =~ /mingw|mswin/
You can’t perform that action at this time.
0 commit comments