summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-09-06 00:59:49 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2012-09-06 00:59:49 +0200
commit58098a77e62ec3ae40180eb36672d44a337121db (patch)
tree4403845bee5809566dcc61e851419559e919217a /Python
parentc5eec0e387f3159288195ea8462345a9738d9a9d (diff)
downloadcpython-git-58098a77e62ec3ae40180eb36672d44a337121db.tar.gz
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 2.7.4 (those which use the trashcan mechanism, despite it being undocumented) will not be loadable by 2.7.3 and earlier. However, extension modules compiled for 2.7.3 and earlier will be loadable by 2.7.4.
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index d7d127b255..56eed88407 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -192,6 +192,9 @@ new_threadstate(PyInterpreterState *interp, int init)
tstate->c_profileobj = NULL;
tstate->c_traceobj = NULL;
+ tstate->trash_delete_nesting = 0;
+ tstate->trash_delete_later = NULL;
+
if (init)
_PyThreadState_Init(tstate);