Skip to content

Commit f9cb8f7

Browse files
committed
Remove needless calls to _PyThreadState_Attach/_PyThreadState_Detach.
1 parent 9f7b014 commit f9cb8f7

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Python/pylifecycle.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,11 +2381,9 @@ make_pre_finalization_calls(PyThreadState *tstate, int subinterpreters)
23812381
break;
23822382
}
23832383
}
2384-
// Temporarily let other threads execute
2385-
_PyThreadState_Detach(tstate);
2384+
23862385
_PyEval_StartTheWorldAll(interp->runtime);
23872386
PyMutex_Unlock(&interp->ceval.pending.mutex);
2388-
_PyThreadState_Attach(tstate);
23892387
}
23902388
assert(PyMutex_IsLocked(&interp->ceval.pending.mutex));
23912389
assert(_Py_atomic_load_uintptr(&interp->finalization_guards) == _PyInterpreterGuard_GUARDS_NOT_ALLOWED);

0 commit comments

Comments
 (0)