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

WorkerThreadPool: Handle exit signal in the tentative scheduling done during waits #76999

Merged
merged 1 commit into from
May 12, 2023

Conversation

RandomShaper
Copy link
Member

The semaphore can be posted for two reasons: a new task is available for processing or exit_threads has been set to true.

The main thread function handles both cases, whereas the edited one didn't, always assuming the former cause. The problem with that is that it may end up trying to take a task from an empty list, leading to crashes or weird bugs.

@RandomShaper RandomShaper added this to the 4.1 milestone May 12, 2023
@RandomShaper RandomShaper requested a review from a team as a code owner May 12, 2023 11:31
@akien-mga akien-mga merged commit 8dd48a9 into godotengine:master May 12, 2023
@akien-mga
Copy link
Member

Thanks!

@RandomShaper RandomShaper deleted the fix_wtp_exit branch May 12, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants