diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2021-12-08 00:26:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 00:26:29 (GMT) |
commit | 1f384e318481532323bb9076f4447bc02da07209 (patch) | |
tree | 41a6930e45fffdae2fa98b83fc1c94f3087115bd /Modules | |
parent | 9b577cd01f66512b503115c0fdbf0734edfd5f8a (diff) | |
download | cpython-1f384e318481532323bb9076f4447bc02da07209.zip cpython-1f384e318481532323bb9076f4447bc02da07209.tar.gz cpython-1f384e318481532323bb9076f4447bc02da07209.tar.bz2 |
bpo-46008: Stop calling _PyThreadState_Init() in new_threadstate(). (gh-29973)
This simplifies new_threadstate(). We also rename _PyThreadState_Init() to _PyThreadState_SetCurrent() to reflect what it actually does.
https://bugs.python.org/issue46008
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_threadmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 2ba081d..cde2e0b 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -6,7 +6,7 @@ #include "pycore_interp.h" // _PyInterpreterState.threads.count #include "pycore_moduleobject.h" // _PyModule_GetState() #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" // _PyThreadState_Init() +#include "pycore_pystate.h" // _PyThreadState_SetCurrent() #include <stddef.h> // offsetof() #include "structmember.h" // PyMemberDef @@ -1087,7 +1087,7 @@ thread_run(void *boot_raw) #else tstate->native_thread_id = 0; #endif - _PyThreadState_Init(tstate); + _PyThreadState_SetCurrent(tstate); PyEval_AcquireThread(tstate); tstate->interp->threads.count++; |