aboutsummaryrefslogtreecommitdiff
path: root/src/partialator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/partialator.c')
-rw-r--r--src/partialator.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/partialator.c b/src/partialator.c
index aa4a5c8c..31c17f63 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -143,8 +143,11 @@ static void refine_all(struct image *images, int n_total_patterns,
qargs.n_total_patterns = n_total_patterns;
qargs.images = images;
+ /* Don't have threads which are doing nothing */
+ if ( n_total_patterns > nthreads ) nthreads = n_total_patterns;
+
run_threads(nthreads, refine_image, get_image, done_image,
- &qargs, n_total_patterns-1, 0, 0, 0);
+ &qargs, n_total_patterns, 0, 0, 0);
}