From fed294c6453527addd1644633849e2d8492058c5 Mon Sep 17 00:00:00 2001 From: Yan Yanchii <46005801+WolframAlph@users.noreply.github.com> Date: Tue, 12 Dec 2023 00:23:41 +0100 Subject: [PATCH] gh-112978: Remove redundant condition inside `take_gil` (gh-112979) --- Python/ceval_gil.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c index 636e4db898f..7581daa55b5 100644 --- a/Python/ceval_gil.c +++ b/Python/ceval_gil.c @@ -307,10 +307,6 @@ take_gil(PyThreadState *tstate) MUTEX_LOCK(gil->mutex); - if (!_Py_atomic_load_int_relaxed(&gil->locked)) { - goto _ready; - } - int drop_requested = 0; while (_Py_atomic_load_int_relaxed(&gil->locked)) { unsigned long saved_switchnum = gil->switch_number; @@ -345,7 +341,6 @@ take_gil(PyThreadState *tstate) } } -_ready: #ifdef FORCE_SWITCHING /* This mutex must be taken before modifying gil->last_holder: see drop_gil(). */