@@ -12,7 +12,6 @@ extern "C" {
12
12
13
13
#include "pycore_ast_state.h" // struct ast_state
14
14
#include "pycore_atexit.h" // struct atexit_state
15
- #include "pycore_atomic.h" // _Py_atomic_address
16
15
#include "pycore_ceval_state.h" // struct _ceval_state
17
16
#include "pycore_code.h" // struct callable_cache
18
17
#include "pycore_context.h" // struct _Py_context_state
@@ -119,7 +118,7 @@ struct _is {
119
118
Use _PyInterpreterState_GetFinalizing()
120
119
and _PyInterpreterState_SetFinalizing()
121
120
to access it, don't access it directly. */
122
- _Py_atomic_address _finalizing ;
121
+ PyThreadState * _finalizing ;
123
122
/* The ID of the OS thread in which we are finalizing. */
124
123
unsigned long _finalizing_id ;
125
124
@@ -244,7 +243,7 @@ extern void _PyInterpreterState_Clear(PyThreadState *tstate);
244
243
245
244
static inline PyThreadState *
246
245
_PyInterpreterState_GetFinalizing (PyInterpreterState * interp ) {
247
- return (PyThreadState * )_Py_atomic_load_relaxed (& interp -> _finalizing );
246
+ return (PyThreadState * )_Py_atomic_load_ptr_relaxed (& interp -> _finalizing );
248
247
}
249
248
250
249
static inline unsigned long
@@ -254,7 +253,7 @@ _PyInterpreterState_GetFinalizingID(PyInterpreterState *interp) {
254
253
255
254
static inline void
256
255
_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 );
258
257
if (tstate == NULL ) {
259
258
_Py_atomic_store_ulong_relaxed (& interp -> _finalizing_id , 0 );
260
259
}
0 commit comments