diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-06 00:59:49 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-06 00:59:49 +0200 |
commit | 2b0218a259083f7124087037bc0ca7338790b6d3 (patch) | |
tree | 70a903c9e401215c8fa93ff00626585e1d6937c1 /Python/pystate.c | |
parent | ef06595535fcb7f4b693f44c568be33b75c1ff06 (diff) | |
download | cpython-git-2b0218a259083f7124087037bc0ca7338790b6d3.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 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.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 8dc570ab75..cfd61d0098 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -206,6 +206,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); |