We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6984e7a commit 9c067bbCopy full SHA for 9c067bb
lib/concurrent/utility/processor_counter.rb
@@ -1,3 +1,4 @@
1
+require 'etc'
2
require 'rbconfig'
3
require 'concurrent/delay'
4
@@ -78,7 +79,7 @@ def physical_processor_count
78
79
def compute_processor_count
80
if Concurrent.on_jruby?
81
java.lang.Runtime.getRuntime.availableProcessors
- elsif defined?(Etc) && Etc.respond_to?(:nprocessors) && (nprocessor = Etc.nprocessors rescue nil)
82
+ elsif Etc.respond_to?(:nprocessors) && (nprocessor = Etc.nprocessors rescue nil)
83
nprocessor
84
else
85
os_name = RbConfig::CONFIG["target_os"]
0 commit comments