8000 gh-111971: Make _PyUnicode_FromId thread-safe in --disable-gil by corona10 · Pull Request #113489 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111971: Make _PyUnicode_FromId thread-safe in --disable-gil #113489

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

Merged
merged 5 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Compiler warn
  • Loading branch information
corona10 committed Dec 26, 2023
commit 175ca6b813824e8c3ac5c54c56a68bbaac136396
2 changes: 1 addition & 1 deletion Include/cpython/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef struct _Py_Identifier {
// For now we are keeping _Py_IDENTIFIER for continued use
// in non-builtin extensions (and naughty PyPI modules).

#define _Py_static_string_init(value) { .string = (value), .index = -1, mutex = 0 }
#define _Py_static_string_init(value) { .string = (value), .index = -1, mutex = {0} }
#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)

Expand Down
2 changes: 1 addition & 1 deletion Programs/_testembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,7 @@ static int test_unicode_id_init(void)
static _Py_Identifier PyId_test_unicode_id_init = {
.string = "test_unicode_id_init",
.index = -1,
.mutex = 0,
.mutex = {0},
};

// Initialize Python once without using the identifier
Expand Down
0