mirror of
https://github.com/facebook/zstd.git
synced 2025-10-11 00:03:06 -04:00
The main issue was to avoid a caller to continually loop on {flush,end}Stream() when there was nothing ready to be flushed but still some compression work ongoing in a worker thread. The continuous loop would have resulted in wasted energy. The new version makes call to {flush,end}Stream blocking when there is nothing ready to be flushed. Of course, if all worker threads have exhausted job, it will return zero (all flush completed). Note : There are still some remaining issues to report error codes and properly collect back resources into pools when an error is triggered.