summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_pystate.h
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-01-30 19:07:48 (GMT)
committerGitHub <noreply@github.com>2023-01-30 19:07:48 (GMT)
commite11fc032a75d067d2167a21037722a770b9dfb51 (patch)
treea9e1b00b661f5ccc131f62f161d2963737bcf03c /Include/internal/pycore_pystate.h
parentea232716d3de1675478db3a302629ba43194c967 (diff)
downloadcpython-e11fc032a75d067d2167a21037722a770b9dfb51.zip
cpython-e11fc032a75d067d2167a21037722a770b9dfb51.tar.gz
cpython-e11fc032a75d067d2167a21037722a770b9dfb51.tar.bz2
gh-59956: Clarify Runtime State Status Expectations (gh-101308)
A PyThreadState can be in one of many states in its lifecycle, represented by some status value. Those statuses haven't been particularly clear, so we're addressing that here. Specifically: * made the distinct lifecycle statuses clear on PyThreadState * identified expectations of how various lifecycle-related functions relate to status * noted the various places where those expectations don't match the actual behavior At some point we'll need to address the mismatches. (This change also includes some cleanup.) https://github.com/python/cpython/issues/59956
Diffstat (limited to 'Include/internal/pycore_pystate.h')
-rw-r--r--Include/internal/pycore_pystate.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 0e46693..7046ec8 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -120,13 +120,12 @@ static inline PyInterpreterState* _PyInterpreterState_GET(void) {
// PyThreadState functions
+PyAPI_FUNC(PyThreadState *) _PyThreadState_New(PyInterpreterState *interp);
PyAPI_FUNC(void) _PyThreadState_Bind(PyThreadState *tstate);
// We keep this around exclusively for stable ABI compatibility.
PyAPI_FUNC(void) _PyThreadState_Init(
PyThreadState *tstate);
-PyAPI_FUNC(void) _PyThreadState_DeleteExcept(
- _PyRuntimeState *runtime,
- PyThreadState *tstate);
+PyAPI_FUNC(void) _PyThreadState_DeleteExcept(PyThreadState *tstate);
static inline void
@@ -139,18 +138,6 @@ _PyThreadState_UpdateTracingState(PyThreadState *tstate)
}
-/* PyThreadState status */
-
-#define PyThreadState_UNINITIALIZED 0
-/* Has been initialized to a safe state.
-
- In order to be effective, this must be set to 0 during or right
- after allocation. */
-#define PyThreadState_INITIALIZED 1
-#define PyThreadState_BOUND 2
-#define PyThreadState_UNBOUND 3
-
-
/* Other */
PyAPI_FUNC(PyThreadState *) _PyThreadState_Swap(