Skip to content

Commit 38fe407

Browse files
Fix up TODO comments.
1 parent 8375a8d commit 38fe407

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/pystate.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ bind_tstate(PyThreadState *tstate)
215215
assert(tstate_is_alive(tstate) && !tstate->_status.bound);
216216
assert(!tstate->_status.unbound); // just in case
217217
assert(!tstate->_status.bound_gilstate);
218+
assert(interp_tss_get(tstate->interp) == NULL);
218219
assert(tstate != gilstate_tss_get(tstate->interp->runtime));
219220
assert(!tstate->_status.active);
220221
assert(tstate->thread_id == 0);
@@ -243,6 +244,8 @@ unbind_tstate(PyThreadState *tstate)
243244
assert(tstate != NULL);
244245
// XXX assert(tstate_is_alive(tstate));
245246
assert(tstate_is_bound(tstate));
247+
assert(!interp_tss_initialized(tstate->interp) ||
248+
tstate == interp_tss_get(tstate->interp));
246249
// XXX assert(!tstate->_status.active);
247250
assert(tstate->thread_id > 0);
248251
#ifdef PY_HAVE_THREAD_NATIVE_ID
@@ -1711,6 +1714,7 @@ _PyThreadState_Swap(_PyRuntimeState *runtime, PyThreadState *newts)
17111714
// XXX assert(tstate_is_alive(oldts) && tstate_is_bound(oldts));
17121715
tstate_deactivate(oldts);
17131716
}
1717+
17141718
if (newts != NULL) {
17151719
assert(tstate_is_alive(newts) && tstate_is_bound(newts));
17161720
current_fast_set(runtime, newts);

0 commit comments

Comments
 (0)