mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Don't add extra threads for single-threaded decompression case.
This commit is contained in:
parent
bb33f7571c
commit
bcb857d934
7
stream.c
7
stream.c
|
|
@ -842,8 +842,11 @@ void *open_stream_in(int f, int n)
|
|||
return NULL;
|
||||
|
||||
/* We have one thread dedicated to stream 0, and one more thread than
|
||||
* CPUs to keep them busy. */
|
||||
total_threads = control.threads + 2;
|
||||
* CPUs to keep them busy, unless we're running single-threaded. */
|
||||
if (control.threads > 1)
|
||||
total_threads = control.threads + 2;
|
||||
else
|
||||
total_threads = control.threads + 1;
|
||||
threads = calloc(sizeof(pthread_t), total_threads);
|
||||
if (unlikely(!threads))
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue