mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
bpo-32436: Implement PEP 567 (#5027)
This commit is contained in:
parent
9089a26591
commit
f23746a934
41 changed files with 6269 additions and 120 deletions
|
@ -173,6 +173,8 @@ PyInterpreterState_New(void)
|
|||
}
|
||||
HEAD_UNLOCK();
|
||||
|
||||
interp->tstate_next_unique_id = 0;
|
||||
|
||||
return interp;
|
||||
}
|
||||
|
||||
|
@ -313,6 +315,11 @@ new_threadstate(PyInterpreterState *interp, int init)
|
|||
tstate->async_gen_firstiter = NULL;
|
||||
tstate->async_gen_finalizer = NULL;
|
||||
|
||||
tstate->context = NULL;
|
||||
tstate->context_ver = 1;
|
||||
|
||||
tstate->id = ++interp->tstate_next_unique_id;
|
||||
|
||||
if (init)
|
||||
_PyThreadState_Init(tstate);
|
||||
|
||||
|
@ -499,6 +506,8 @@ PyThreadState_Clear(PyThreadState *tstate)
|
|||
Py_CLEAR(tstate->coroutine_wrapper);
|
||||
Py_CLEAR(tstate->async_gen_firstiter);
|
||||
Py_CLEAR(tstate->async_gen_finalizer);
|
||||
|
||||
Py_CLEAR(tstate->context);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue