bpo-39984: _PyThreadState_DeleteCurrent() takes tstate (GH-19051)

* _PyThreadState_DeleteCurrent() now takes tstate rather than
  runtime.
* Add ensure_tstate_not_null() helper to pystate.c.
* Add _PyEval_ReleaseLock() function.
* _PyThreadState_DeleteCurrent() now calls
  _PyEval_ReleaseLock(tstate) and frees PyThreadState memory after
  this call, not before.
* PyGILState_Release(): rename "tcur" variable to "tstate".
This commit is contained in:
Victor Stinner 2020-03-18 02:26:04 +01:00 committed by GitHub
parent d7fabc1162
commit 23ef89db7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 32 deletions

View file

@ -57,6 +57,8 @@ extern PyObject *_PyEval_EvalCode(
extern int _PyEval_ThreadsInitialized(_PyRuntimeState *runtime);
extern PyStatus _PyEval_InitThreads(PyThreadState *tstate);
extern void _PyEval_ReleaseLock(PyThreadState *tstate);
/* --- _Py_EnterRecursiveCall() ----------------------------------------- */