Skip to content

Commit fed294c

Browse files
authored
gh-112978: Remove redundant condition inside take_gil (gh-112979)
1 parent 1c5fc02 commit fed294c

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Python/ceval_gil.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,6 @@ take_gil(PyThreadState *tstate)
307307

308308
MUTEX_LOCK(gil->mutex);
309309

310-
if (!_Py_atomic_load_int_relaxed(&gil->locked)) {
311-
goto _ready;
312-
}
313-
314310
int drop_requested = 0;
315311
while (_Py_atomic_load_int_relaxed(&gil->locked)) {
316312
unsigned long saved_switchnum = gil->switch_number;
@@ -345,7 +341,6 @@ take_gil(PyThreadState *tstate)
345341
}
346342
}
347343

348-
_ready:
349344
#ifdef FORCE_SWITCHING
350345
/* This mutex must be taken before modifying gil->last_holder:
351346
see drop_gil(). */

0 commit comments

Comments
 (0)