File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,6 +133,9 @@ extern struct _PyInterpreterFrame* _PyEval_GetFrame(void);
133133
134134extern PyObject * _Py_MakeCoro (PyFunctionObject * func );
135135
136+ extern int _Py_HandlePending (PyThreadState * tstate );
137+
138+
136139#ifdef __cplusplus
137140}
138141#endif
Original file line number Diff line number Diff line change @@ -85,13 +85,14 @@ _PyThreadState_GET(void)
8585 return _PyRuntimeState_GetThreadState (& _PyRuntime );
8686}
8787
88- PyAPI_FUNC (void ) _Py_NO_RETURN _Py_FatalError_TstateNULL (const char * func );
89-
9088static inline void
9189_Py_EnsureFuncTstateNotNULL (const char * func , PyThreadState * tstate )
9290{
9391 if (tstate == NULL ) {
94- _Py_FatalError_TstateNULL (func );
92+ _Py_FatalErrorFunc (func ,
93+ "the function must be called with the GIL held, "
94+ "after Python initialization and before Python finalization, "
95+ "but the GIL is released (the current Python thread state is NULL)" );
9596 }
9697}
9798
Original file line number Diff line number Diff line change @@ -388,6 +388,7 @@ PYTHON_OBJS= \
388388 Python/getcopyright.o \
389389 Python/getplatform.o \
390390 Python/getversion.o \
391+ Python/ceval_gil.o \
391392 Python/hamt.o \
392393 Python/hashtable.o \
393394 Python/import.o \
@@ -1419,8 +1420,7 @@ regen-opcode-targets:
14191420 $(srcdir)/Python/opcode_targets.h.new
14201421 $(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
14211422
1422- Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \
1423- $(srcdir)/Python/condvar.h
1423+ Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/condvar.h
14241424
14251425Python/frozen.o: $(FROZEN_FILES_OUT)
14261426
Original file line number Diff line number Diff line change 199199 <ClCompile Include =" ..\Python\getopt.c" />
200200 <ClCompile Include =" ..\Python\getplatform.c" />
201201 <ClCompile Include =" ..\Python\getversion.c" />
202+ <ClCompile Include =" ..\Python\ceval_gil.c" />
202203 <ClCompile Include =" ..\Python\hamt.c" />
203204 <ClCompile Include =" ..\Python\hashtable.c" />
204205 <ClCompile Include =" ..\Python\import.c" />
Original file line number Diff line number Diff line change 184184 <ClCompile Include =" ..\Python\getversion.c" >
185185 <Filter >Source Files</Filter >
186186 </ClCompile >
187+ <ClCompile Include =" ..\Python\ceval_gil.c" >
188+ <Filter >Source Files</Filter >
189+ </ClCompile >
187190 <ClCompile Include =" ..\Python\hamt.c" >
188191 <Filter >Source Files</Filter >
189192 </ClCompile >
Original file line number Diff line number Diff line change 327327 <ClInclude Include =" ..\Parser\pegen.h" />
328328 <ClInclude Include =" ..\PC\errmap.h" />
329329 <ClInclude Include =" ..\PC\pyconfig.h" />
330- <ClInclude Include =" ..\Python\ceval_gil.h" />
331330 <ClInclude Include =" ..\Python\condvar.h" />
332331 <ClInclude Include =" ..\Python\importdl.h" />
333332 <ClInclude Include =" ..\Python\stdlib_module_names.h" />
502501 <ClCompile Include =" ..\Python\getopt.c" />
503502 <ClCompile Include =" ..\Python\getplatform.c" />
504503 <ClCompile Include =" ..\Python\getversion.c" />
504+ <ClCompile Include =" ..\Python\ceval_gil.c" />
505505 <ClCompile Include =" ..\Python\hamt.c" />
506506 <ClCompile Include =" ..\Python\hashtable.c" />
507507 <ClCompile Include =" ..\Python\import.c" />
Original file line number Diff line number Diff line change 312312 <ClInclude Include =" ..\Python\condvar.h" >
313313 <Filter >Python</Filter >
314314 </ClInclude >
315- <ClInclude Include =" ..\Python\ceval_gil.h" >
316- <Filter >Python</Filter >
317- </ClInclude >
318315 <ClInclude Include =" ..\Include\pyhash.h" >
319316 <Filter >Include</Filter >
320317 </ClInclude >
10971094 <ClCompile Include =" ..\Python\getversion.c" >
10981095 <Filter >Python</Filter >
10991096 </ClCompile >
1097+ <ClCompile Include =" ..\Python\ceval_gil.c" >
1098+ <Filter >Python</Filter >
1099+ </ClCompile >
11001100 <ClCompile Include =" ..\Python\hashtable.c" >
11011101 <Filter >Modules</Filter >
11021102 </ClCompile >
You can’t perform that action at this time.
0 commit comments