reduced POOL_resize() restriction

It's not necessary to ensure that no job is ongoing.
The pool is only expanded, existing threads are preserved.
In case of error, the only option is to return NULL and terminate the thread pool anyway.
This commit is contained in:
Yann Collet committed 2018-06-19 18:07:18 -07:00
1 parent 066fbbfe1c
commit 166901dc72
3 files changed
+1 -6

No files matched your search

-1
View File
@@ -188,7 +188,6 @@ size_t POOL_sizeof(POOL_ctx *ctx) {
/* note : only works if no job is running ! */
static POOL_ctx* POOL_resize_internal(POOL_ctx* ctx, size_t numThreads)
{
if (ctx->numThreadsBusy > 0) return NULL;
if (numThreads <= ctx->threadCapacity) {
ctx->threadLimit = numThreads;
return ctx;