gh-112978: Remove redundant condition inside take_gil (gh-112979)

This commit is contained in:
Yan Yanchii 2023-12-12 00:23:41 +01:00 committed by GitHub
parent 1c5fc02fd0
commit fed294c645
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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(). */