X Tutup
Skip to content

Make Variant::get_type_by_name HashMap initialization thread-safe#113211

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
aaronp64:type_by_name_map
Dec 2, 2025
Merged

Make Variant::get_type_by_name HashMap initialization thread-safe#113211
akien-mga merged 1 commit intogodotengine:masterfrom
aaronp64:type_by_name_map

Conversation

@aaronp64
Copy link
Contributor

Updated Variant::get_type_by_name to call separate function for static HashMap initialization, which includes adding the initial key/value pairs.

Fixes #113210

Updated Variant::get_type_by_name to call separate function for static HashMap initialization, which includes adding the initial key/value pairs.
@aaronp64 aaronp64 requested a review from a team as a code owner November 26, 2025 20:33
Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

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

Both the issue and the fix make sense to me.
For reference, the keyword is C++11 thread-safe static initialization (e.g. listed here).

@Ivorforce Ivorforce added this to the 4.6 milestone Nov 26, 2025
@akien-mga akien-mga merged commit 6d4ad21 into godotengine:master Dec 2, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@aaronp64 aaronp64 deleted the type_by_name_map branch December 2, 2025 15:12
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.

Variant::get_type_by_name HashMap initialization is not thread-safe

3 participants

X Tutup