@@ -338,7 +338,7 @@ PyThreadState_Delete(PyThreadState *tstate)
338
338
Py_FatalError ("PyThreadState_Delete: tstate is still current" );
339
339
tstate_delete_common (tstate );
340
340
#ifdef WITH_THREAD
341
- if (autoTLSkey && PyThread_get_key_value (autoTLSkey ) == tstate )
341
+ if (autoInterpreterState && PyThread_get_key_value (autoTLSkey ) == tstate )
342
342
PyThread_delete_key_value (autoTLSkey );
343
343
#endif /* WITH_THREAD */
344
344
}
@@ -354,7 +354,7 @@ PyThreadState_DeleteCurrent()
354
354
"PyThreadState_DeleteCurrent: no current tstate" );
355
355
_PyThreadState_Current = NULL ;
356
356
tstate_delete_common (tstate );
357
- if (autoTLSkey && PyThread_get_key_value (autoTLSkey ) == tstate )
357
+ if (autoInterpreterState && PyThread_get_key_value (autoTLSkey ) == tstate )
358
358
PyThread_delete_key_value (autoTLSkey );
359
359
PyEval_ReleaseLock ();
360
360
}
574
574
_PyGILState_Fini (void )
575
575
{
576
576
PyThread_delete_key (autoTLSkey );
577
- autoTLSkey = 0 ;
578
577
autoInterpreterState = NULL ;
579
578
}
580
579
@@ -586,10 +585,10 @@ _PyGILState_Fini(void)
586
585
static void
587
586
_PyGILState_NoteThreadState (PyThreadState * tstate )
588
587
{
589
- /* If autoTLSkey is 0 , this must be the very first threadstate created
590
- in Py_Initialize(). Don't do anything for now (we'll be back here
591
- when _PyGILState_Init is called). */
592
- if (!autoTLSkey )
588
+ /* If autoTLSkey isn't initialized , this must be the very first
589
+ threadstate created in Py_Initialize(). Don't do anything for now
590
+ (we'll be back here when _PyGILState_Init is called). */
591
+ if (!autoInterpreterState )
593
592
return ;
594
593
595
594
/* Stick the thread state for this thread in thread local storage.
@@ -617,7 +616,7 @@ _PyGILState_NoteThreadState(PyThreadState* tstate)
617
616
PyThreadState *
618
617
PyGILState_GetThisThreadState (void )
619
618
{
620
- if (autoInterpreterState == NULL || autoTLSkey == 0 )
619
+ if (autoInterpreterState == NULL )
621
620
return NULL ;
622
621
return (PyThreadState * )PyThread_get_key_value (autoTLSkey );
623
622
}
0 commit comments