Mercurial > cpython-lru_cache-weakref
diff Python/pystate.c @ 36687:7d0f12340c9e 2.4
Merge rev 42607 from the trunk.
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).
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Mon, 27 Feb 2006 17:47:02 +0000 |
| parents | 6d04cb2cdd4a |
| children | ab13576374b1 |
line wrap: on
line diff
--- a/Python/pystate.c Mon Feb 27 17:22:16 2006 +0000 +++ b/Python/pystate.c Mon Feb 27 17:47:02 2006 +0000 @@ -262,6 +262,10 @@ 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 */ }
