aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tpool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tpool.c b/src/tpool.c
index 3e8a0de..739607e 100644
--- a/src/tpool.c
+++ b/src/tpool.c
@@ -45,6 +45,8 @@ tpinit(tpool_t *tp, const char **files, ptrdiff_t filecnt)
tp->tcnt = MIN(tp->tcnt, filecnt);
tp->wi = 0;
+ if (tp->tcnt == 1)
+ return 0; /* Initiate single-threaded behaviour */
if (tp->tcnt <= 32)
tp->thrds = thread_buffer;
else if ((tp->thrds = malloc(sizeof(*tp->thrds) * tp->tcnt)) == nullptr)