Skip to content

Add Mutex from upstream Godot, and put the upstream Mutex into CoreBind - #2032

Merged
dsnopek merged 1 commit into
godotengine:masterfrom
Ivorforce:native-mutex
Jul 29, 2026
Merged

Add Mutex from upstream Godot, and put the upstream Mutex into CoreBind#2032
dsnopek merged 1 commit into
godotengine:masterfrom
Ivorforce:native-mutex

Conversation

@Ivorforce

@Ivorforce Ivorforce commented Jul 26, 2026

Copy link
Copy Markdown
Member

As mentioned in #2026, using the bound mutex is suboptimal because it's heap allocated (must be used with Ref) and unnecessarily slow.
Instead, this syncs the upstream Mutex, and moves the exposed upstream one into CoreBind, matching upstream itself.

@Ivorforce
Ivorforce requested a review from a team as a code owner July 26, 2026 17:27
@Ivorforce Ivorforce added bug This has been identified as a bug enhancement This is an enhancement on the current functionality labels Jul 26, 2026
…oreBind`.

Co-authored-by: David Snopek <dsnopek@gmail.com>

@dsnopek dsnopek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

I haven't tested, but this looks good to me. I like the godot::CoreBind namespace - I wonder if we should use that for our ClassDBSingleton too? It's similarly the bound version, and then we have a custom version (which forwards to the bound version on some methods)

@dsnopek dsnopek added this to the 10.x milestone Jul 29, 2026
@dsnopek
dsnopek merged commit 82c6c44 into godotengine:master Jul 29, 2026
20 checks passed
@Ivorforce
Ivorforce deleted the native-mutex branch July 29, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This has been identified as a bug enhancement This is an enhancement on the current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Macros "_THREAD_SAFE_XXX" in " include/godot_cpp/core/mutex_lock.hpp" are not work correctly in godot-cpp.

2 participants