Skip to content

Commit 9c067bb

Browse files
committed
Always require etc for ProcessorCounter
1 parent 6984e7a commit 9c067bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/concurrent/utility/processor_counter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'etc'
12
require 'rbconfig'
23
require 'concurrent/delay'
34

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

0 commit comments

Comments
 (0)