Skip to content

Commit 735739b

Browse files
committed
Fix previous commit
1 parent 13cda89 commit 735739b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/app/BlockCompressor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/app/BlockDecompressor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)