summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-18 01:26:04 (GMT)
committerGitHub <noreply@github.com>2020-03-18 01:26:04 (GMT)
commit23ef89db7ae46d160650263cc80479c2ed6693fb (patch)
tree10113d5c3774882bf9f22ad91f863f07e907717f /Include
parentd7fabc116269e4650a684eb04f9ecd84421aa247 (diff)
downloadcpython-23ef89db7ae46d160650263cc80479c2ed6693fb.zip
cpython-23ef89db7ae46d160650263cc80479c2ed6693fb.tar.gz
cpython-23ef89db7ae46d160650263cc80479c2ed6693fb.tar.bz2
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".
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_ceval.h2
-rw-r--r--Include/internal/pycore_pylifecycle.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h
index ec00d18..5aeef6c 100644
--- a/Include/internal/pycore_ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -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() ----------------------------------------- */
diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h
index cf22803..77ea3f2 100644
--- a/Include/internal/pycore_pylifecycle.h
+++ b/Include/internal/pycore_pylifecycle.h
@@ -104,7 +104,7 @@ PyAPI_FUNC(void) _PyErr_Print(PyThreadState *tstate);
PyAPI_FUNC(void) _PyErr_Display(PyObject *file, PyObject *exception,
PyObject *value, PyObject *tb);
-PyAPI_FUNC(void) _PyThreadState_DeleteCurrent(struct pyruntimestate *runtime);
+PyAPI_FUNC(void) _PyThreadState_DeleteCurrent(PyThreadState *tstate);
#ifdef __cplusplus
}