summaryrefslogtreecommitdiff
path: root/src/choices.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2017-01-31 18:13:27 -0800
committerJohn Hawthorn <john.hawthorn@gmail.com>2017-01-31 18:25:35 -0800
commit5aeaaa3de01b98e935dab1367cf2a7900feaecf3 (patch)
treeea58351bc9ad08f36c5db15cd13359ca5a35f5f9 /src/choices.c
parent15b29a48af2175f620d0acad00bac59d2d5d8630 (diff)
Add -j option to control parallelism
Diffstat (limited to 'src/choices.c')
-rw-r--r--src/choices.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/choices.c b/src/choices.c
index 01480cb..64f9a8b 100644
--- a/src/choices.c
+++ b/src/choices.c
@@ -107,7 +107,11 @@ void choices_init(choices_t *c, options_t *options) {
c->capacity = c->size = 0;
choices_resize(c, INITIAL_CHOICE_CAPACITY);
- c->worker_count = (int)sysconf(_SC_NPROCESSORS_ONLN);
+ if (options->workers) {
+ c->worker_count = options->workers;
+ } else {
+ c->worker_count = (int)sysconf(_SC_NPROCESSORS_ONLN);
+ }
choices_reset_search(c);
}