-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7z sample deadlocks #4
Comments
Fixing the sample to dispose the encoder solves the deadlock issue but uncovers another bug: the encoder doesn't properly detect the shutdown request and starts another iteration, later tripping up when the streams are getting closed. This may actually work in practice, assuming an uncaught exception on a thread intended to be terminated anyways is ignored, but a clean shutdown is obviously preferrable. |
Issue #4 - encoder must be disposed or the encoding thread will hang, waiting for more data. This also uncovers a bug during encoder shutdown where the encoder thread trips over the closed stream.
Introduce an additional state to avoid starting another encoder loop during shutdown.
Start the encoder loop when pushing the first file after the encoder has been disconnected.
Must start in idle state, otherwise a decoder which was never used asserts during shutdown.
Above commits should cover the most common cases, closing this issue for now. |
After "fixing" issue #2 the sample deadlocks and does not terminate because the encoder threads are waiting for something. It has been a while since I worked on that part so the fix may have been wrong, or this may be a bug after all. Investigate.
The text was updated successfully, but these errors were encountered: