summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/pystate.h1
-rw-r--r--Include/internal/pycore_interp.h2
-rw-r--r--Include/internal/pycore_pystate.h5
3 files changed, 8 insertions, 0 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 5e184d0..7e4c57e 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -211,6 +211,7 @@ struct _ts {
* if it is NULL. */
PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void);
+
// Disable tracing and profiling.
PyAPI_FUNC(void) PyThreadState_EnterTracing(PyThreadState *tstate);
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h
index 0912bd1..ebf0228 100644
--- a/Include/internal/pycore_interp.h
+++ b/Include/internal/pycore_interp.h
@@ -73,6 +73,8 @@ struct _is {
uint64_t next_unique_id;
/* The linked list of threads, newest first. */
PyThreadState *head;
+ /* The thread currently executing in the __main__ module, if any. */
+ PyThreadState *main;
/* Used in Modules/_threadmodule.c. */
long count;
/* Support for runtime thread stack size tuning.
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 2e568f8..6a36dba 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -44,6 +44,11 @@ _Py_IsMainInterpreterFinalizing(PyInterpreterState *interp)
interp == &_PyRuntime._main_interpreter);
}
+// Export for _xxsubinterpreters module.
+PyAPI_FUNC(int) _PyInterpreterState_SetRunningMain(PyInterpreterState *);
+PyAPI_FUNC(void) _PyInterpreterState_SetNotRunningMain(PyInterpreterState *);
+PyAPI_FUNC(int) _PyInterpreterState_IsRunningMain(PyInterpreterState *);
+
static inline const PyConfig *
_Py_GetMainConfig(void)