From 6dd381eb62278f75de7ba01626813de84cd248e7 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 21 Nov 2011 21:26:56 +0100 Subject: 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. --- Modules/_multiprocessing/multiprocessing.c | 35 ------------------------------ 1 file changed, 35 deletions(-) (limited to 'Modules/_multiprocessing/multiprocessing.c') 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 */ -- cgit v1.2.1