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

Remove our ERR_ON_RENDER_THREAD guard, it is not reliable #94121

Merged

Conversation

BastiaanOlij
Copy link
Contributor

I introduced the ERR_ON_RENDER_THREAD and ERR_NOT_ON_RENDER_THREAD guards when adding thread safety to the XR capabilities of Godot.

The problem that we encounter here is when we are not using multithreaded rendering, the main thread and the render thread are the same thread.
Adding a guard that fails when we are on the render thread to make sure a method is only called from the main thread, will give a false positive in this scenario. I'm thus removing ERR_ON_RENDER_THREAD as unreliable.

ERR_NOT_ON_RENDER_THREAD on the other hand is valid, this ensures code is run from the render thread and will properly guard for that situation.

@BastiaanOlij BastiaanOlij added this to the 4.3 milestone Jul 9, 2024
@BastiaanOlij BastiaanOlij self-assigned this Jul 9, 2024
@BastiaanOlij BastiaanOlij requested a review from a team as a code owner July 9, 2024 08:52
@BastiaanOlij BastiaanOlij requested a review from clayjohn July 9, 2024 08:53
@akien-mga akien-mga changed the title Remove our ERR_ON_RENDER_THREAD guard, it is not reliable Remove our ERR_ON_RENDER_THREAD guard, it is not reliable Jul 10, 2024
@akien-mga akien-mga merged commit c5ca288 into godotengine:master Jul 10, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@BastiaanOlij BastiaanOlij deleted the remove_render_thread_guard branch August 20, 2024 01:52
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.

4 participants