[issue11668] _multiprocessing.Connection.poll with timeout uses polling under Windows
Antoine Pitrou
report at bugs.python.org
Sat Mar 26 14:49:25 CET 2011
Antoine Pitrou <pitrou at free.fr> added the comment:
Are you sure about MP_EXCEPTION_HAS_BEEN_SET?
semaphore.c has a more sophisticated logic:
Py_BEGIN_ALLOW_THREADS
ResetEvent(sigint_event);
res = WaitForMultipleObjects(2, handles, FALSE, msecs);
Py_END_ALLOW_THREADS
/* handle result */
if (res != WAIT_OBJECT_0 + 1)
break;
/* got SIGINT so give signal handler a chance to run */
Sleep(1);
/* if this is main thread let KeyboardInterrupt be raised */
if (PyErr_CheckSignals())
return NULL;
/* recalculate timeout */
if (msecs != INFINITE) {
ticks = GetTickCount();
if ((DWORD)(ticks - start) >= full_msecs)
Py_RETURN_FALSE;
msecs = full_msecs - (ticks - start);
}
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11668>
_______________________________________
More information about the Python-bugs-list
mailing list