Skip to content

Commit 8a42e24

Browse files
committed
Keep the async-signal-safety comment on the handler slot update
1 parent 2123fdc commit 8a42e24

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Modules/signalmodule.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ get_handler(int i)
139139
Py_LOCAL_INLINE(PyObject *)
140140
swap_handler(int i, PyObject *func)
141141
{
142+
/* The slot is updated with an atomic operation so that
143+
PyErr_SetInterrupt() stays async-signal-safe. */
142144
PyObject *old = _Py_atomic_exchange_ptr(&Handlers[i].func,
143145
Py_XNewRef(func));
144146
PyObject *result = Py_XNewRef(old);

0 commit comments

Comments
 (0)