mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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
This commit is contained in:
parent
9b577cd01f
commit
1f384e3184
3 changed files with 18 additions and 10 deletions
|
@ -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++;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue