diff Python/pystate.c @ 78912:5aa1bc2f00ad

Issue #13992: The trashcan mechanism is now thread-safe. This eliminates sporadic crashes in multi-thread programs when several long deallocator chains ran concurrently and involved subclasses of built-in container types. Because of this change, a couple extension modules compiled for 3.2.4 (those which use the trashcan mechanism, despite it being undocumented) will not be loadable by 3.2.3 and earlier. However, extension modules compiled for 3.2.3 and earlier will be loadable by 3.2.4.
author Antoine Pitrou <solipsis@pitrou.net>
date Thu, 06 Sep 2012 00:59:49 +0200
parents 7789111afe05
children 800507fb0a7e
line wrap: on
line diff
--- a/Python/pystate.c	Sat Sep 08 07:58:37 2012 +0200
+++ b/Python/pystate.c	Thu Sep 06 00:59:49 2012 +0200
@@ -206,6 +206,9 @@
         tstate->c_profileobj = NULL;
         tstate->c_traceobj = NULL;
 
+        tstate->trash_delete_nesting = 0;
+        tstate->trash_delete_later = NULL;
+
         if (init)
             _PyThreadState_Init(tstate);