@@ -9,7 +9,6 @@ extern "C" {
9
9
#endif
10
10
11
11
#include "pycore_atexit.h" // struct _atexit_runtime_state
12
- #include "pycore_atomic.h" // _Py_atomic_address
13
12
#include "pycore_ceval_state.h" // struct _ceval_runtime_state
14
13
#include "pycore_faulthandler.h" // struct _faulthandler_runtime_state
15
14
#include "pycore_floatobject.h" // struct _Py_float_runtime_state
@@ -170,7 +169,7 @@ typedef struct pyruntimestate {
170
169
171
170
Use _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing()
172
171
to access it, don't access it directly. */
173
- _Py_atomic_address _finalizing ;
172
+ PyThreadState * _finalizing ;
174
173
/* The ID of the OS thread in which we are finalizing. */
175
174
unsigned long _finalizing_id ;
176
175
@@ -299,7 +298,7 @@ extern void _PyRuntime_Finalize(void);
299
298
300
299
static inline PyThreadState *
301
300
_PyRuntimeState_GetFinalizing (_PyRuntimeState * runtime ) {
302
- return (PyThreadState * )_Py_atomic_load_relaxed (& runtime -> _finalizing );
301
+ return (PyThreadState * )_Py_atomic_load_ptr_relaxed (& runtime -> _finalizing );
303
302
}
304
303
305
304
static inline unsigned long
@@ -309,7 +308,7 @@ _PyRuntimeState_GetFinalizingID(_PyRuntimeState *runtime) {
309
308
310
309
static inline void
311
310
_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 );
313
312
if (tstate == NULL ) {
314
313
_Py_atomic_store_ulong_relaxed (& runtime -> _finalizing_id , 0 );
315
314
}
0 commit comments