mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
Patch 1413181, by Gabriel Becedillas.
PyThreadState_Delete(): if the auto-GIL-state machinery knows about the thread state, forget it (since the thread state is being deleted, continuing to remember it can't help, but can hurt if another thread happens to get created with the same thread id). I'll backport to 2.4 next.
This commit is contained in:
parent
8622e93eab
commit
f4e6928c4d
2 changed files with 10 additions and 0 deletions
|
@ -262,6 +262,10 @@ PyThreadState_Delete(PyThreadState *tstate)
|
|||
if (tstate == _PyThreadState_Current)
|
||||
Py_FatalError("PyThreadState_Delete: tstate is still current");
|
||||
tstate_delete_common(tstate);
|
||||
#ifdef WITH_THREAD
|
||||
if (autoTLSkey && PyThread_get_key_value(autoTLSkey) == tstate)
|
||||
PyThread_delete_key_value(autoTLSkey);
|
||||
#endif /* WITH_THREAD */
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue