Remove our ERR_ON_RENDER_THREAD
guard, it is not reliable
#94121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I introduced the
ERR_ON_RENDER_THREAD
andERR_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.