Commit 4d6be0c194d92aca3957650adca6e3514b91aec4

Jeff Garzik 2011-06-09T03:47:07

Fix number-of-threads init logic on Windows

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/cpu-miner.c b/cpu-miner.c
index 1d502b5..a3de4b9 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -856,7 +856,10 @@ static void parse_arg (int key, char *arg)
 		show_usage();
 	}
 
-#ifndef WIN32
+#ifdef WIN32
+	if (!opt_n_threads)
+		opt_n_threads = 1;
+#else
 	num_processors = sysconf(_SC_NPROCESSORS_ONLN);
 	if (!opt_n_threads)
 		opt_n_threads = num_processors;