Skip to content

Commit addfa2b

Browse files
PyOS_InterruptOccurred
1 parent b2b68d4 commit addfa2b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Doc/c-api/sys.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ Operating System Utilities
123123
This is a thin wrapper around either :c:func:`!sigaction` or :c:func:`!signal`. Do
124124
not call those functions directly!
125125
126+
127+
.. c:function:: int PyOS_InterruptOccurred(void)
128+
129+
Check if a :c:macro:`!SIGINT` signal has been received.
130+
Returns ``1`` if a :c:macro:`!SIGINT` has occurred and clears the signal flag,
131+
or ``0`` otherwise.
132+
133+
The caller must hold an :term:`attached thread state`.
134+
135+
126136
.. c:function:: wchar_t* Py_DecodeLocale(const char* arg, size_t *size)
127137
128138
.. warning::

Modules/signalmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ _PyOS_InterruptOccurred(PyThreadState *tstate)
20252025
}
20262026

20272027

2028-
// The caller must to hold the GIL
2028+
// The caller must hold the GIL
20292029
int
20302030
PyOS_InterruptOccurred(void)
20312031
{

0 commit comments

Comments
 (0)