mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
gh-120973: Fix thread-safety issues with threading.local
(#121655)
This is a small refactoring to the current design that allows us to avoid manually iterating over threads. This should also fix gh-118490.
This commit is contained in:
parent
2009e25e26
commit
e059aa6b01
3 changed files with 245 additions and 150 deletions
|
@ -1702,6 +1702,9 @@ PyThreadState_Clear(PyThreadState *tstate)
|
|||
|
||||
/* Don't clear tstate->pyframe: it is a borrowed reference */
|
||||
|
||||
Py_CLEAR(tstate->threading_local_key);
|
||||
Py_CLEAR(tstate->threading_local_sentinel);
|
||||
|
||||
Py_CLEAR(((_PyThreadStateImpl *)tstate)->asyncio_running_loop);
|
||||
|
||||
Py_CLEAR(tstate->dict);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue