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

Force get_thread_count() to 1 if single threaded #99416

Merged

Conversation

adamscott
Copy link
Member

@adamscott adamscott commented Nov 19, 2024

This PR makes sure that WorkerThreadPool::get_singleton()->get_thread_count() returns 1 when threads=no. Otherwise, a lot of WorkerThreadPool calls will not run as threads.size() would return 0 in single-thread builds, as jobs are set as done if no elements/threads are available.

Alternative to #98121
Fixes #88192

@adamscott adamscott added bug topic:core needs testing cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Nov 19, 2024
@adamscott adamscott added this to the 4.4 milestone Nov 19, 2024
@adamscott adamscott requested a review from a team as a code owner November 19, 2024 03:32
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.
Worth waiting for an OK from Pedro too.

@Repiteo Repiteo merged commit 514d73a into godotengine:master Nov 22, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 22, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:core
Projects
None yet
4 participants