mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
da2914db4b
commit
d2a8e5b42c
5 changed files with 49 additions and 53 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue