@@ -9,7 +9,6 @@ extern "C" {
99#endif
1010
1111#include "pycore_atexit.h" // struct _atexit_runtime_state
12- #include "pycore_atomic.h" // _Py_atomic_address
1312#include "pycore_ceval_state.h" // struct _ceval_runtime_state
1413#include "pycore_faulthandler.h" // struct _faulthandler_runtime_state
1514#include "pycore_floatobject.h" // struct _Py_float_runtime_state
@@ -170,7 +169,7 @@ typedef struct pyruntimestate {
170169
171170 Use _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing()
172171 to access it, don't access it directly. */
173- _Py_atomic_address _finalizing ;
172+ PyThreadState * _finalizing ;
174173 /* The ID of the OS thread in which we are finalizing. */
175174 unsigned long _finalizing_id ;
176175
@@ -299,7 +298,7 @@ extern void _PyRuntime_Finalize(void);
299298
300299static inline PyThreadState *
301300_PyRuntimeState_GetFinalizing (_PyRuntimeState * runtime ) {
302- return (PyThreadState * )_Py_atomic_load_relaxed (& runtime -> _finalizing );
301+ return (PyThreadState * )_Py_atomic_load_ptr_relaxed (& runtime -> _finalizing );
303302}
304303
305304static inline unsigned long
@@ -309,7 +308,7 @@ _PyRuntimeState_GetFinalizingID(_PyRuntimeState *runtime) {
309308
310309static inline void
311310_PyRuntimeState_SetFinalizing (_PyRuntimeState * runtime , PyThreadState * tstate ) {
312- _Py_atomic_store_relaxed (& runtime -> _finalizing , ( uintptr_t ) tstate );
311+ _Py_atomic_store_ptr_relaxed (& runtime -> _finalizing , tstate );
313312 if (tstate == NULL ) {
314313 _Py_atomic_store_ulong_relaxed (& runtime -> _finalizing_id , 0 );
315314 }
0 commit comments