void PyThreadState_Delete(PyThreadState *tstate) { if (tstate == _PyThreadState_Current) Py_FatalError("PyThreadState_Delete: tstate is still current"); tstate_delete_common(tstate); #ifdef WITH_THREAD if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate) PyThread_delete_key_value(autoTLSkey); #endif /* WITH_THREAD */ }
void PyThreadState_Delete(PyThreadState *tstate) { if (tstate == _PyThreadState_GET()) Py_FatalError("PyThreadState_Delete: tstate is still current"); if (_PyRuntime.gilstate.autoInterpreterState && PyThread_tss_get(&_PyRuntime.gilstate.autoTSSkey) == tstate) { PyThread_tss_set(&_PyRuntime.gilstate.autoTSSkey, NULL); } tstate_delete_common(tstate); }
void PyThreadState_DeleteCurrent() { PyThreadState *tstate = _PyThreadState_Current; if (tstate == NULL) Py_FatalError( "PyThreadState_DeleteCurrent: no current tstate"); _PyThreadState_Current = NULL; tstate_delete_common(tstate); if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate) PyThread_delete_key_value(autoTLSkey); PyEval_ReleaseLock(); }
void PyThreadState_DeleteCurrent() { PyThreadState *tstate = (PyThreadState*)_Py_atomic_load_relaxed( &_PyThreadState_Current); if (tstate == NULL) Py_FatalError( "PyThreadState_DeleteCurrent: no current tstate"); _Py_atomic_store_relaxed(&_PyThreadState_Current, NULL); if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate) PyThread_delete_key_value(autoTLSkey); tstate_delete_common(tstate); PyEval_ReleaseLock(); }
void PyThreadState_DeleteCurrent() { PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) Py_FatalError( "PyThreadState_DeleteCurrent: no current tstate"); tstate_delete_common(tstate); if (_PyRuntime.gilstate.autoInterpreterState && PyThread_tss_get(&_PyRuntime.gilstate.autoTSSkey) == tstate) { PyThread_tss_set(&_PyRuntime.gilstate.autoTSSkey, NULL); } _PyThreadState_SET(NULL); PyEval_ReleaseLock(); }