]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112978: Remove redundant condition inside `take_gil` (gh-112979)
authorYan Yanchii <46005801+WolframAlph@users.noreply.github.com>
Mon, 11 Dec 2023 23:23:41 +0000 (00:23 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2023 23:23:41 +0000 (08:23 +0900)
Python/ceval_gil.c

index 636e4db898f2d9b143946398554a1606ef59cde3..7581daa55b5e467fc55ad50ff46c2ba2d95a5e58 100644 (file)
@@ -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(). */