Drop PyThreadState.whence. · python/cpython@c40f162 · GitHub
Skip to content

Commit c40f162

Browse files
Drop PyThreadState.whence.
1 parent 0ec39ff commit c40f162

7 files changed

Lines changed: 13 additions & 37 deletions

File tree

Include/cpython/pystate.h

Lines changed: 0 additions & 9 deletions

Include/internal/pycore_pystate.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ static inline PyInterpreterState* _PyInterpreterState_GET(void) {
133133

134134
// PyThreadState functions
135135

136-
PyAPI_FUNC(PyThreadState *) _PyThreadState_New(
137-
PyInterpreterState *interp,
138-
int whence);
136+
PyAPI_FUNC(PyThreadState *) _PyThreadState_New(PyInterpreterState *interp);
139137
PyAPI_FUNC(void) _PyThreadState_Bind(PyThreadState *tstate);
140138
// We keep this around exclusively for stable ABI compatibility.
141139
PyAPI_FUNC(void) _PyThreadState_Init(

Include/internal/pycore_runtime_init.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ extern PyTypeObject _PyExc_MemoryError;
127127

128128
#define _PyThreadState_INIT \
129129
{ \
130-
._whence = _PyThreadState_WHENCE_NOTSET, \
131130
.py_recursion_limit = Py_DEFAULT_RECURSION_LIMIT, \
132131
.context_ver = 1, \
133132
}

Modules/_threadmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ thread_PyThread_start_new_thread(PyObject *self, PyObject *fargs)
12031203
if (boot == NULL) {
12041204
return PyErr_NoMemory();
12051205
}
1206-
boot->tstate = _PyThreadState_New(interp, _PyThreadState_WHENCE_THREADING);
1206+
boot->tstate = _PyThreadState_New(interp);
12071207
if (boot->tstate == NULL) {
12081208
PyMem_RawFree(boot);
12091209
if (!PyErr_Occurred()) {

Modules/_xxsubinterpretersmodule.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ _run_script_in_interpreter(PyObject *mod, PyInterpreterState *interp,
483483
PyThreadState *tstate = NULL;
484484
if (interp != PyInterpreterState_Get()) {
485485
tstate = PyThreadState_New(interp);
486-
tstate->_whence = _PyThreadState_WHENCE_EXEC;
487486
// XXX Possible GILState issues?
488487
save_tstate = PyThreadState_Swap(tstate);
489488
}
@@ -611,7 +610,6 @@ interp_destroy(PyObject *self, PyObject *args, PyObject *kwds)
611610

612611
// Destroy the interpreter.
613612
PyThreadState *tstate = PyThreadState_New(interp);
614-
tstate->_whence = _PyThreadState_WHENCE_INTERP;
615613
// XXX Possible GILState issues?
616614
PyThreadState *save_tstate = PyThreadState_Swap(tstate);
617615
Py_EndInterpreter(tstate);

Python/pylifecycle.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,7 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
650650
return status;
651651
}
652652

653-
PyThreadState *tstate = _PyThreadState_New(interp,
654-
_PyThreadState_WHENCE_INTERP);
653+
PyThreadState *tstate = _PyThreadState_New(interp);
655654
if (tstate == NULL) {
656655
return _PyStatus_ERR("can't make first thread");
657656
}
@@ -2026,8 +2025,7 @@ new_interpreter(PyThreadState **tstate_p, const PyInterpreterConfig *config)
20262025
return _PyStatus_OK();
20272026
}
20282027

2029-
PyThreadState *tstate = _PyThreadState_New(interp,
2030-
_PyThreadState_WHENCE_INTERP);
2028+
PyThreadState *tstate = _PyThreadState_New(interp);
20312029
if (tstate == NULL) {
20322030
PyInterpreterState_Delete(interp);
20332031
*tstate_p = NULL;

Python/pystate.c

Lines changed: 9 additions & 17 deletions

0 commit comments

Comments
 (0)