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

Fix deadlock when canceling the slicing while gcode is creating thumbnails #6476

Closed

Conversation

supermerill
Copy link
Contributor

When creating thumbnail, it push a process on the gui thread and wait for it to finish.
But when cancelling, the gui thread switch the cancel flag and lock again (waiting for exception?)

So if we cancel just before the creation of thumbnails, then there is a deadlock.

Here is an extensive and complicated way to solve that problem.
The minimum is to throw_if_canceled(); just before sending & waiting for the thumbnail creation, that way the chance of this use occurring should be very small.

bubnikv added a commit that referenced this pull request May 4, 2021
…onously

from the background slicing thread, that supports cancellation.
The generic mechanism is used for generating thumbnails into G-code and
Fixes Fix deadlock when canceling the slicing while gcode is creating thumbnails #6476
Thanks @supermerill for pointing out the issue.
@bubnikv
Copy link
Collaborator

bubnikv commented May 4, 2021

Thanks for pointing out the issue. Fixed with 1aef86f in a generic way, supporting immediate cancellation.

@bubnikv bubnikv closed this May 4, 2021
supermerill pushed a commit to supermerill/SuperSlicer that referenced this pull request Jun 3, 2021
…onously

from the background slicing thread, that supports cancellation.
The generic mechanism is used for generating thumbnails into G-code and
Fixes Fix deadlock when canceling the slicing while gcode is creating thumbnails prusa3d#6476
Thanks @supermerill for pointing out the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants