Skip to content
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

Closed
weltkante opened this issue Feb 24, 2015 · 2 comments
Closed

7z sample deadlocks #4

weltkante opened this issue Feb 24, 2015 · 2 comments
Assignees
Labels

Comments

@weltkante
Copy link
Owner

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.

@weltkante weltkante added the bug label Feb 24, 2015
@weltkante weltkante self-assigned this Feb 24, 2015
This was referenced Feb 24, 2015
@weltkante
Copy link
Owner Author

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.

weltkante added a commit that referenced this issue Mar 3, 2015
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.
weltkante added a commit that referenced this issue Mar 5, 2015
Introduce an additional state to avoid starting another encoder loop
during shutdown.
weltkante added a commit that referenced this issue Mar 5, 2015
Start the encoder loop when pushing the first file after the encoder has
been disconnected.
weltkante added a commit that referenced this issue Mar 5, 2015
Must start in idle state, otherwise a decoder which was never used
asserts during shutdown.
@weltkante
Copy link
Owner Author

Above commits should cover the most common cases, closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant