@@ -12,7 +12,6 @@ extern "C" {
1212
1313#include "pycore_ast_state.h" // struct ast_state
1414#include "pycore_atexit.h" // struct atexit_state
15- #include "pycore_atomic.h" // _Py_atomic_address
1615#include "pycore_ceval_state.h" // struct _ceval_state
1716#include "pycore_code.h" // struct callable_cache
1817#include "pycore_context.h" // struct _Py_context_state
@@ -119,7 +118,7 @@ struct _is {
119118 Use _PyInterpreterState_GetFinalizing()
120119 and _PyInterpreterState_SetFinalizing()
121120 to access it, don't access it directly. */
122- _Py_atomic_address _finalizing ;
121+ PyThreadState * _finalizing ;
123122 /* The ID of the OS thread in which we are finalizing. */
124123 unsigned long _finalizing_id ;
125124
@@ -244,7 +243,7 @@ extern void _PyInterpreterState_Clear(PyThreadState *tstate);
244243
245244static inline PyThreadState *
246245_PyInterpreterState_GetFinalizing (PyInterpreterState * interp ) {
247- return (PyThreadState * )_Py_atomic_load_relaxed (& interp -> _finalizing );
246+ return (PyThreadState * )_Py_atomic_load_ptr_relaxed (& interp -> _finalizing );
248247}
249248
250249static inline unsigned long
@@ -254,7 +253,7 @@ _PyInterpreterState_GetFinalizingID(PyInterpreterState *interp) {
254253
255254static inline void
256255_PyInterpreterState_SetFinalizing (PyInterpreterState * interp , PyThreadState * tstate ) {
257- _Py_atomic_store_relaxed (& interp -> _finalizing , ( uintptr_t ) tstate );
256+ _Py_atomic_store_ptr_relaxed (& interp -> _finalizing , tstate );
258257 if (tstate == NULL ) {
259258 _Py_atomic_store_ulong_relaxed (& interp -> _finalizing_id , 0 );
260259 }
0 commit comments