diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-21 21:26:56 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-21 21:26:56 +0100 |
commit | 6dd381eb62278f75de7ba01626813de84cd248e7 (patch) | |
tree | 4b843b5767b3296212c5dbe8c696c1081b2fbfe0 /Modules/_multiprocessing/multiprocessing.c | |
parent | ce4a9da70535b4bb9048147b141f01004af2133d (diff) | |
download | cpython-git-6dd381eb62278f75de7ba01626813de84cd248e7.tar.gz |
Issue #12328: Under Windows, refactor handling of Ctrl-C events and
make _multiprocessing.win32.WaitForMultipleObjects interruptible when
the wait_flag parameter is false. Patch by sbt.
Diffstat (limited to 'Modules/_multiprocessing/multiprocessing.c')
-rw-r--r-- | Modules/_multiprocessing/multiprocessing.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index 890b96d7dc..ab2cd72d31 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -53,30 +53,6 @@ mp_SetError(PyObject *Type, int num) } -/* - * Windows only - */ - -#ifdef MS_WINDOWS - -/* On Windows we set an event to signal Ctrl-C; compare with timemodule.c */ - -HANDLE sigint_event = NULL; - -static BOOL WINAPI -ProcessingCtrlHandler(DWORD dwCtrlType) -{ - SetEvent(sigint_event); - return FALSE; -} - -#endif /* MS_WINDOWS */ - - -/* - * All platforms - */ - static PyObject* multiprocessing_address_of_buffer(PyObject *self, PyObject *obj) { @@ -165,17 +141,6 @@ PyInit__multiprocessing(void) if (!temp) return NULL; PyModule_AddObject(module, "win32", temp); - - /* Initialize the event handle used to signal Ctrl-C */ - sigint_event = CreateEvent(NULL, TRUE, FALSE, NULL); - if (!sigint_event) { - PyErr_SetFromWindowsErr(0); - return NULL; - } - if (!SetConsoleCtrlHandler(ProcessingCtrlHandler, TRUE)) { - PyErr_SetFromWindowsErr(0); - return NULL; - } #endif /* Add configuration macros */ |