Skip to content
Permalink
Browse files

Always require etc for ProcessorCounter

  • Loading branch information...
jhawthorn committed Jul 8, 2019
1 parent 6984e7a commit 9c067bb9927908f5ff19d3fa0160ce119e90aa07
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/concurrent/utility/processor_counter.rb
@@ -1,3 +1,4 @@
require 'etc'
require 'rbconfig'
require 'concurrent/delay'

@@ -78,7 +79,7 @@ def physical_processor_count
def compute_processor_count
if Concurrent.on_jruby?
java.lang.Runtime.getRuntime.availableProcessors
elsif defined?(Etc) && Etc.respond_to?(:nprocessors) && (nprocessor = Etc.nprocessors rescue nil)
elsif Etc.respond_to?(:nprocessors) && (nprocessor = Etc.nprocessors rescue nil)
nprocessor
else
os_name = RbConfig::CONFIG["target_os"]

0 comments on commit 9c067bb

Please sign in to comment.
You can’t perform that action at this time.