Miss Islington (bot) b2b9aaa93d
[3.14] gh-135099: Only wait on _PyOS_SigintEvent() in main thread (GH-135100) (GH-135116)
On Windows, the `_PyOS_SigintEvent()` event handle is used to interrupt
the main thread when Ctrl-C is pressed. Previously, we also waited on
the event from other threads, but ignored the result. However, this can
race with interpreter shutdown because the main thread closes the handle
in `_PySignal_Fini` and threads may still be running and using mutexes
during interpreter shtudown.

Only use `_PyOS_SigintEvent()` in the main thread in parking_lot.c, like
we do in other places in the CPython codebase.
(cherry picked from commit cc581f32bf5f15e9f2f89b830ec64ea25684d0cd)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-06-04 08:44:35 -04:00
..
2025-04-30 11:46:41 +02:00
2025-04-30 11:46:41 +02:00

Miscellaneous source files for the main Python shared library