Detect correct number of processors on windows
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Mar 2016 16:25:28 +0000 (16:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Mar 2016 16:25:28 +0000 (16:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155884

Patch by Bill Ming <mbbill@gmail.com> on 2016-03-25
Reviewed by Alex Christensen.

* Tools/Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198670 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Tools/Scripts/run-jsc-stress-tests

index 276b4d9..e6e91a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-03-25  Bill Ming  <mbbill@gmail.com>
+
+        Detect correct number of processors on windows
+        https://bugs.webkit.org/show_bug.cgi?id=155884
+
+        Reviewed by Alex Christensen.
+
+        * Tools/Scripts/run-jsc-stress-tests:
+
 2016-03-25  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Improve CMake build performance 
index 19b2825..d399ebb 100755 (executable)
@@ -1694,17 +1694,21 @@ def runCommandOnTester(cmd)
 end
 
 def numberOfProcessors
-    begin
-        numProcessors = runCommandOnTester("sysctl -n hw.activecpu 2>/dev/null").to_i
-    rescue
-        numProcessors = 0
-    end
-
-    if numProcessors == 0
+    if $hostOS == "windows"
+        numProcessors = runCommandOnTester("cmd /c echo %NUMBER_OF_PROCESSORS%").to_i
+    else
         begin
-            numProcessors = runCommandOnTester("nproc --all 2>/dev/null").to_i
+            numProcessors = runCommandOnTester("sysctl -n hw.activecpu 2>/dev/null").to_i
         rescue
-            numProcessors == 0
+            numProcessors = 0
+        end
+
+        if numProcessors == 0
+            begin
+                numProcessors = runCommandOnTester("nproc --all 2>/dev/null").to_i
+            rescue
+                numProcessors == 0
+            end
         end
     end