mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-38858: Add _Py_IsMainInterpreter(tstate) (GH-17293)
This commit is contained in:
parent
db7925a1ca
commit
fff7bbfdb6
3 changed files with 11 additions and 3 deletions
|
@ -159,6 +159,12 @@ _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