From d2a8e5b42c5e9c4e745a0589043a8aebb49f8ca2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 20 Mar 2020 13:38:58 +0100 Subject: bpo-40010: COMPUTE_EVAL_BREAKER() checks for subinterpreter (GH-19087) COMPUTE_EVAL_BREAKER() now also checks if the Python thread state belongs to the main interpreter. Don't break the evaluation loop if there are pending signals but the Python thread state it belongs to a subinterpeter. * Add _Py_IsMainThread() function. * Add _Py_ThreadCanHandleSignals() function. --- Python/pystate.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Python/pystate.c') diff --git a/Python/pystate.c b/Python/pystate.c index a792cc5622d..621318f4b5a 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -169,12 +169,6 @@ _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime) #define HEAD_UNLOCK(runtime) \ PyThread_release_lock((runtime)->interpreters.mutex) -int -_Py_IsMainInterpreter(PyThreadState* tstate) -{ - return (tstate->interp == tstate->interp->runtime->interpreters.main); -} - /* Forward declaration */ static void _PyGILState_NoteThreadState( struct _gilstate_runtime_state *gilstate, PyThreadState* tstate); -- cgit v1.2.3