Skip to content

[3.12] gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 #111588

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 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 7 additions & 5 deletions Include/moduleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ struct PyModuleDef_Slot {
#define _Py_mod_LAST_SLOT 3
#endif

/* for Py_mod_multiple_interpreters: */
#define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0)
#define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1)
#define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2)

#endif /* New in 3.5 */

/* for Py_mod_multiple_interpreters: */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000
# define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0)
# define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1)
# define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2)
#endif

struct PyModuleDef {
PyModuleDef_Base m_base;
const char* m_name;
Expand Down
3 changes: 2 additions & 1 deletion Modules/xxlimited.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
pass
*/

#define Py_LIMITED_API 0x030b0000
// Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
#define Py_LIMITED_API 0x030c0000

#include "Python.h"
#include <string.h>
Expand Down
1 change: 0 additions & 1 deletion Modules/xxlimited_35.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ xx_modexec(PyObject *m)

static PyModuleDef_Slot xx_slots[] = {
{Py_mod_exec, xx_modexec},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{0, NULL}
};

Expand Down