mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-43311: Create GIL autoTSSkey ealier (GH-24819)
At Python startup, call _PyGILState_Init() before PyInterpreterState_New() which calls _PyThreadState_GET(). When Python is built using --with-experimental-isolated-subinterpreters, _PyThreadState_GET() uses autoTSSkey.
This commit is contained in:
parent
9a9c11ad41
commit
87f649a409
3 changed files with 28 additions and 7 deletions
|
@ -8,6 +8,8 @@ extern "C" {
|
|||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "pycore_runtime.h" // _PyRuntimeState
|
||||
|
||||
/* Forward declarations */
|
||||
struct _PyArgv;
|
||||
struct pyruntimestate;
|
||||
|
@ -88,7 +90,8 @@ extern void _PyWarnings_Fini(PyInterpreterState *interp);
|
|||
extern void _PyAST_Fini(PyInterpreterState *interp);
|
||||
extern void _PyAtExit_Fini(PyInterpreterState *interp);
|
||||
|
||||
extern PyStatus _PyGILState_Init(PyThreadState *tstate);
|
||||
extern PyStatus _PyGILState_Init(_PyRuntimeState *runtime);
|
||||
extern PyStatus _PyGILState_SetTstate(PyThreadState *tstate);
|
||||
extern void _PyGILState_Fini(PyInterpreterState *interp);
|
||||
|
||||
PyAPI_FUNC(void) _PyGC_DumpShutdownStats(PyInterpreterState *interp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue