summaryrefslogtreecommitdiffstats
path: root/Python/ceval_gil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval_gil.c')
-rw-r--r--Python/ceval_gil.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c
index 29796be..4d501c8 100644
--- a/Python/ceval_gil.c
+++ b/Python/ceval_gil.c
@@ -546,8 +546,7 @@ _PyEval_Fini(void)
void
PyEval_AcquireLock(void)
{
- _PyRuntimeState *runtime = &_PyRuntime;
- PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
+ PyThreadState *tstate = _PyThreadState_GET();
_Py_EnsureTstateNotNULL(tstate);
take_gil(tstate);
@@ -557,7 +556,7 @@ void
PyEval_ReleaseLock(void)
{
_PyRuntimeState *runtime = &_PyRuntime;
- PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
+ PyThreadState *tstate = _PyThreadState_GET();
/* This function must succeed when the current thread state is NULL.
We therefore avoid PyThreadState_Get() which dumps a fatal error
in debug mode. */