@@ -3473,9 +3473,6 @@ PyInterpreterView_FromMain(void)
34733473static const PyThreadStateToken * _no_tstate_sentinel = (const PyThreadStateToken * )& _no_tstate_sentinel ;
34743474#define NO_TSTATE_SENTINEL ((PyThreadStateToken *)_no_tstate_sentinel)
34753475
3476- static const PyThreadStateToken * _detached_sentinel = (const PyThreadStateToken * )& _detached_sentinel ;
3477- #define DETACHED_TSTATE_SENTINEL ((PyThreadStateToken *)_detached_sentinel)
3478-
34793476PyThreadStateToken *
34803477PyThreadState_Ensure (PyInterpreterGuard * guard )
34813478{
@@ -3495,7 +3492,7 @@ PyThreadState_Ensure(PyInterpreterGuard *guard)
34953492 assert (attached_tstate == NULL );
34963493 ++ detached_gilstate -> ensure .counter ;
34973494 _PyThreadState_Attach (detached_gilstate );
3498- return DETACHED_TSTATE_SENTINEL ;
3495+ return NO_TSTATE_SENTINEL ;
34993496 }
35003497
35013498 PyThreadState * fresh_tstate = _PyThreadState_NewBound (interp ,
@@ -3557,14 +3554,14 @@ PyThreadState_Release(PyThreadStateToken *token)
35573554 if (remaining != 0 ) {
35583555 // If the corresponding PyThreadState_Ensure() call used a detached
35593556 // thread state, we want to detach it again.
3560- if (token == DETACHED_TSTATE_SENTINEL ) {
3557+ if (token == NO_TSTATE_SENTINEL ) {
35613558 PyThreadState_Swap (NULL );
35623559 }
35633560 return ;
35643561 }
35653562
35663563 PyThreadState * to_restore ;
3567- if (token == NO_TSTATE_SENTINEL || token == DETACHED_TSTATE_SENTINEL ) {
3564+ if (token == NO_TSTATE_SENTINEL ) {
35683565 to_restore = NULL ;
35693566 }
35703567 else {
0 commit comments