mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #27336: Fix compilation failures --without-threads
This commit is contained in:
parent
d4b45cb9ca
commit
531396c764
3 changed files with 6 additions and 3 deletions
|
@ -38,12 +38,13 @@ Py_Exit(int sts)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
/* Functions needed by obmalloc.c */
|
/* Needed by obmalloc.c */
|
||||||
int PyGILState_Check(void)
|
int PyGILState_Check(void)
|
||||||
{ return 1; }
|
{ return 1; }
|
||||||
|
#endif
|
||||||
|
|
||||||
void _PyMem_DumpTraceback(int fd, const void *ptr)
|
void _PyMem_DumpTraceback(int fd, const void *ptr)
|
||||||
{}
|
{}
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
|
|
|
@ -746,9 +746,11 @@ Py_NewInterpreter(void)
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
Py_FatalError("Py_NewInterpreter: call Py_Initialize first");
|
Py_FatalError("Py_NewInterpreter: call Py_Initialize first");
|
||||||
|
|
||||||
|
#if WITH_THREAD
|
||||||
/* Issue #10915, #15751: The GIL API doesn't work with multiple
|
/* Issue #10915, #15751: The GIL API doesn't work with multiple
|
||||||
interpreters: disable PyGILState_Check(). */
|
interpreters: disable PyGILState_Check(). */
|
||||||
_PyGILState_check_enabled = 0;
|
_PyGILState_check_enabled = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
interp = PyInterpreterState_New();
|
interp = PyInterpreterState_New();
|
||||||
if (interp == NULL)
|
if (interp == NULL)
|
||||||
|
|
|
@ -745,7 +745,7 @@ _Py_DumpTracebackThreads(int fd, PyInterpreterState *interp,
|
||||||
if (current_tstate == NULL) {
|
if (current_tstate == NULL) {
|
||||||
/* Call _PyThreadState_UncheckedGet() instead of PyThreadState_Get()
|
/* Call _PyThreadState_UncheckedGet() instead of PyThreadState_Get()
|
||||||
to not fail with a fatal error if the thread state is NULL. */
|
to not fail with a fatal error if the thread state is NULL. */
|
||||||
current_thread = _PyThreadState_UncheckedGet();
|
current_tstate = _PyThreadState_UncheckedGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interp == NULL) {
|
if (interp == NULL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue