liblzma: Fix a wrong comment in stream_encoder_mt.c.

This commit is contained in:
Lasse Collin 2021-01-24 19:22:35 +02:00
parent 939fc5ed65
commit 6b8abc84a5
1 changed files with 7 additions and 3 deletions

View File

@ -640,9 +640,13 @@ wait_for_work(lzma_stream_coder *coder, mythread_condtime *wait_abs,
// to true here and calculate the absolute time when // to true here and calculate the absolute time when
// we must return if there's nothing to do. // we must return if there's nothing to do.
// //
// The idea of *has_blocked is to avoid unneeded calls // This way if we block multiple times for short moments
// to mythread_condtime_set(), which may do a syscall // less than "timeout" milliseconds, we will return once
// depending on the operating system. // "timeout" amount of time has passed since the *first*
// blocking occurred. If the absolute time was calculated
// again every time we block, "timeout" would effectively
// be meaningless if we never consecutively block longer
// than "timeout" ms.
*has_blocked = true; *has_blocked = true;
mythread_condtime_set(wait_abs, &coder->cond, coder->timeout); mythread_condtime_set(wait_abs, &coder->cond, coder->timeout);
} }