[Python-checkins] r42613 - in python/branches/release24-maint: Misc/NEWS Python/pystate.c

tim.peters python-checkins at python.org
Mon Feb 27 18:47:04 CET 2006


Author: tim.peters
Date: Mon Feb 27 18:47:02 2006
New Revision: 42613

Modified:
   python/branches/release24-maint/Misc/NEWS
   python/branches/release24-maint/Python/pystate.c
Log:
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).


Modified: python/branches/release24-maint/Misc/NEWS
==============================================================================
--- python/branches/release24-maint/Misc/NEWS	(original)
+++ python/branches/release24-maint/Misc/NEWS	Mon Feb 27 18:47:02 2006
@@ -44,6 +44,12 @@
 
 - Fix segfault with invalid coding.
 
+- Patch #1413181:  changed ``PyThreadState_Delete()`` to forget about the
+  current thread state when the auto-GIL-state machinery knows about
+  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).
+
 Extension Modules
 -----------------
 

Modified: python/branches/release24-maint/Python/pystate.c
==============================================================================
--- python/branches/release24-maint/Python/pystate.c	(original)
+++ python/branches/release24-maint/Python/pystate.c	Mon Feb 27 18:47:02 2006
@@ -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 */
 }
 
 


More information about the Python-checkins mailing list