File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,10 @@ int BlockCompressor::compress(uint64& outputSize)
312312 }
313313 }
314314
315+ #ifdef CONCURRENCY_ENABLED
316+ ThreadPool pool (_jobs + 1 ); // +1 to avoid deadlock due to thread exhaustion
317+ #endif
318+
315319 _ctx.putInt (" verbosity" , _verbosity);
316320
317321 // Run the task(s)
@@ -385,7 +389,6 @@ int BlockCompressor::compress(uint64& outputSize)
385389 }
386390
387391#ifdef CONCURRENCY_ENABLED
388- ThreadPool pool (_jobs + 1 ); // +1 to avoid deadlock due to thread exhaustion
389392 Context taskCtx (_ctx, &pool);
390393 taskCtx.putInt (" jobs" , jobsPerTask[i]);
391394#else
Original file line number Diff line number Diff line change @@ -224,6 +224,10 @@ int BlockDecompressor::decompress(uint64& inputSize)
224224
225225 _ctx.putInt (" verbosity" , _verbosity);
226226
227+ #ifdef CONCURRENCY_ENABLED
228+ ThreadPool pool (_jobs + 1 ); // +1 to avoid deadlock due to thread exhaustion
229+ #endif
230+
227231 // Run the task(s)
228232 if (nbFiles == 1 ) {
229233 string oName = formattedOutName;
@@ -300,7 +304,6 @@ int BlockDecompressor::decompress(uint64& inputSize)
300304 }
301305
302306#ifdef CONCURRENCY_ENABLED
303- ThreadPool pool (_jobs + 1 ); // +1 to avoid deadlock due to thread exhaustion
304307 Context taskCtx (_ctx, &pool);
305308 taskCtx.putInt (" jobs" , jobsPerTask[i]);
306309#else
You can’t perform that action at this time.
0 commit comments