File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments