diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-11-21 01:04:21 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-11-21 01:04:21 (GMT) |
commit | b9a4501179eec7762fcf3536833707f58d2474d2 (patch) | |
tree | 3bad8bed599dae83840223a687aaa98c70ef1895 /Python/pythonrun.c | |
parent | 527d4ace8537a4db6dca65955a41470be4f07269 (diff) | |
download | cpython-b9a4501179eec7762fcf3536833707f58d2474d2.zip cpython-b9a4501179eec7762fcf3536833707f58d2474d2.tar.gz cpython-b9a4501179eec7762fcf3536833707f58d2474d2.tar.bz2 |
Issue #21963: backout issue #1856 patch (avoid crashes and lockups when
daemon threads run while the interpreter is shutting down; instead,
these threads are now killed when they try to take the GIL), as it seems
to break some existing code.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 05bb62b..ade5efe 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -91,8 +91,6 @@ int _Py_QnewFlag = 0; int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */ -PyThreadState *_Py_Finalizing = NULL; - /* Hack to force loading of object files */ int (*_PyOS_mystrnicmp_hack)(const char *, const char *, Py_ssize_t) = \ @@ -165,7 +163,6 @@ Py_InitializeEx(int install_sigs) if (initialized) return; initialized = 1; - _Py_Finalizing = NULL; if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') Py_DebugFlag = add_flag(Py_DebugFlag, p); @@ -425,16 +422,12 @@ Py_Finalize(void) * the threads created via Threading. */ call_sys_exitfunc(); + initialized = 0; /* Get current thread state and interpreter pointer */ tstate = PyThreadState_GET(); interp = tstate->interp; - /* Remaining threads (e.g. daemon threads) will automatically exit - after taking the GIL (in PyEval_RestoreThread()). */ - _Py_Finalizing = tstate; - initialized = 0; - /* Disable signal handling */ PyOS_FiniInterrupts(); |