From 0616eafa2e440ab81065bf966348ad8dc8217e30 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sat, 7 Oct 2023 00:03:02 +0900 Subject: [PATCH 1/2] gh-109693: Use pyatomic.h for signal module --- Modules/signalmodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index ac3457003b0cb6..52fcd0a867edf5 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -4,7 +4,7 @@ /* XXX Signals should be recorded per thread, now we have thread state. */ #include "Python.h" -#include "pycore_atomic.h" // _Py_atomic_int +#include "pyatomic.h" // _Py_atomic_store_uintptr _Py_atomic_load_uintptr #include "pycore_call.h" // _PyObject_Call() #include "pycore_ceval.h" // _PyEval_SignalReceived() #include "pycore_emscripten_signal.h" // _Py_CHECK_EMSCRIPTEN_SIGNALS @@ -124,13 +124,13 @@ typedef struct { Py_LOCAL_INLINE(PyObject *) get_handler(int i) { - return (PyObject *)_Py_atomic_load(&Handlers[i].func); + return (PyObject *)_Py_atomic_load_uintptr(&Handlers[i].func); } Py_LOCAL_INLINE(void) set_handler(int i, PyObject* func) { - _Py_atomic_store(&Handlers[i].func, (uintptr_t)func); + _Py_atomic_store_uintptr(&Handlers[i].func, (uintptr_t)func); } From ade5b198b778e992f0a2ca40a0e74e3b1ab6532e Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sat, 7 Oct 2023 00:13:31 +0900 Subject: [PATCH 2/2] Remove unnecessary header --- Modules/signalmodule.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 52fcd0a867edf5..af44c75d4b679c 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -4,7 +4,6 @@ /* XXX Signals should be recorded per thread, now we have thread state. */ #include "Python.h" -#include "pyatomic.h" // _Py_atomic_store_uintptr _Py_atomic_load_uintptr #include "pycore_call.h" // _PyObject_Call() #include "pycore_ceval.h" // _PyEval_SignalReceived() #include "pycore_emscripten_signal.h" // _Py_CHECK_EMSCRIPTEN_SIGNALS