@@ -903,7 +903,7 @@ _PyInterpreterState_Clear(PyThreadState *tstate)
903
903
904
904
905
905
static inline void tstate_deactivate (PyThreadState * tstate );
906
- static void tstate_set_detached (PyThreadState * tstate );
906
+ static void tstate_set_detached (PyThreadState * tstate , int detached_state );
907
907
static void zapthreads (PyInterpreterState * interp );
908
908
909
909
void
@@ -1686,7 +1686,7 @@ _PyThreadState_DeleteCurrent(PyThreadState *tstate)
1686
1686
#ifdef Py_GIL_DISABLED
1687
1687
_Py_qsbr_detach (((_PyThreadStateImpl * )tstate )-> qsbr );
1688
1688
#endif
1689
- tstate_set_detached (tstate );
1689
+ tstate_set_detached (tstate , _Py_THREAD_DETACHED );
1690
1690
tstate_delete_common (tstate );
1691
1691
current_fast_clear (tstate -> interp -> runtime );
1692
1692
_PyEval_ReleaseLock (tstate -> interp , NULL );
@@ -1859,13 +1859,13 @@ tstate_try_attach(PyThreadState *tstate)
1859
1859
}
1860
1860
1861
1861
static void
1862
- tstate_set_detached (PyThreadState * tstate )
1862
+ tstate_set_detached (PyThreadState * tstate , int detached_state )
1863
1863
{
1864
1864
assert (tstate -> state == _Py_THREAD_ATTACHED );
1865
1865
#ifdef Py_GIL_DISABLED
1866
- _Py_atomic_store_int (& tstate -> state , _Py_THREAD_DETACHED );
1866
+ _Py_atomic_store_int (& tstate -> state , detached_state );
1867
1867
#else
1868
- tstate -> state = _Py_THREAD_DETACHED ;
1868
+ tstate -> state = detached_state ;
1869
1869
#endif
1870
1870
}
1871
1871
@@ -1935,7 +1935,7 @@ detach_thread(PyThreadState *tstate, int detached_state)
1935
1935
_Py_qsbr_detach (((_PyThreadStateImpl * )tstate )-> qsbr );
1936
1936
#endif
1937
1937
tstate_deactivate (tstate );
1938
- tstate_set_detached (tstate );
1938
+ tstate_set_detached (tstate , detached_state );
1939
1939
current_fast_clear (& _PyRuntime );
1940
1940
_PyEval_ReleaseLock (tstate -> interp , tstate );
1941
1941
}
0 commit comments