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

Work around a race condition with ScriptServer during initialization #74501

Closed
wants to merge 1 commit into from
Closed

Work around a race condition with ScriptServer during initialization #74501

wants to merge 1 commit into from

Conversation

myaaaaaaaaa
Copy link
Contributor

@myaaaaaaaaa myaaaaaaaaa commented Mar 6, 2023

Split off from #73793

Currently, WorkerThreadPool is initialized before ScriptServer, so there's a race condition where worker threads call into ScriptServer::thread_enter() before languages are registered. Since ScriptServer isn't always initialized (for example, when Godot is run with --help), there's no synchronization point where threads can wait for languages to be registered before proceeding, so we just disable it for now.

The proper fix is of course to rearrange main() so that threads and WorkerThreadPool are initialized last, which should probably wait until after #49362 (or possibly even be done there). This can be reverted afterwards.

Needed for ThreadSanitizer #73777

@myaaaaaaaaa
Copy link
Contributor Author

Closing in favor of #76586 (comment)

@akien-mga akien-mga modified the milestones: 4.2, 4.1 Jun 21, 2023
@myaaaaaaaaa myaaaaaaaaa deleted the script-thread branch June 21, 2023 14:06
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