Skip to content

Commit a9c6e06

Browse files
gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205)
Here we are doing no more than adding the value for Py_mod_multiple_interpreters and using it for stdlib modules. We will start checking for it in gh-104206 (once PyInterpreterState.ceval.own_gil is added in gh-104204).
1 parent 1c420e1 commit a9c6e06

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+144
-4
lines changed

Include/moduleobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct PyModuleDef_Slot {
8787
/* for Py_mod_multiple_interpreters: */
8888
#define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0)
8989
#define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1)
90+
#define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2)
9091

9192
#endif /* New in 3.5 */
9293

Modules/_abc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ _abcmodule_free(void *module)
944944

945945
static PyModuleDef_Slot _abcmodule_slots[] = {
946946
{Py_mod_exec, _abcmodule_exec},
947+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
947948
{0, NULL}
948949
};
949950

Modules/_asynciomodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,6 +3803,7 @@ module_exec(PyObject *mod)
38033803

38043804
static struct PyModuleDef_Slot module_slots[] = {
38053805
{Py_mod_exec, module_exec},
3806+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
38063807
{0, NULL},
38073808
};
38083809

Modules/_bisectmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ bisect_modexec(PyObject *m)
457457

458458
static PyModuleDef_Slot bisect_slots[] = {
459459
{Py_mod_exec, bisect_modexec},
460+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
460461
{0, NULL}
461462
};
462463

Modules/_blake2/blake2module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ blake2_exec(PyObject *m)
127127

128128
static PyModuleDef_Slot _blake2_slots[] = {
129129
{Py_mod_exec, blake2_exec},
130+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
130131
{0, NULL}
131132
};
132133

@@ -146,4 +147,4 @@ PyMODINIT_FUNC
146147
PyInit__blake2(void)
147148
{
148149
return PyModuleDef_Init(&blake2_module);
149-
}
150+
}

Modules/_bz2module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ _bz2_free(void *module)
799799

800800
static struct PyModuleDef_Slot _bz2_slots[] = {
801801
{Py_mod_exec, _bz2_exec},
802+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
802803
{0, NULL}
803804
};
804805

Modules/_codecsmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ static PyMethodDef _codecs_functions[] = {
10491049
};
10501050

10511051
static PyModuleDef_Slot _codecs_slots[] = {
1052+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
10521053
{0, NULL}
10531054
};
10541055

Modules/_collectionsmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,6 +2571,7 @@ collections_exec(PyObject *module) {
25712571

25722572
static struct PyModuleDef_Slot collections_slots[] = {
25732573
{Py_mod_exec, collections_exec},
2574+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
25742575
{0, NULL}
25752576
};
25762577

Modules/_contextvarsmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ _contextvars_exec(PyObject *m)
4444

4545
static struct PyModuleDef_Slot _contextvars_slots[] = {
4646
{Py_mod_exec, _contextvars_exec},
47+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
4748
{0, NULL}
4849
};
4950

Modules/_cryptmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static PyMethodDef crypt_methods[] = {
5858
};
5959

6060
static PyModuleDef_Slot _crypt_slots[] = {
61+
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
6162
{0, NULL}
6263
};
6364

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy