]> granicus.if.org Git - python/commit
asyncio, tulip issue 196: ProactorIocp._register() now registers the overlapped
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 27 Jul 2014 22:18:43 +0000 (00:18 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 27 Jul 2014 22:18:43 +0000 (00:18 +0200)
commit42d3bdeed6e34117b787d61a471563a0dba6a894
tree017c9bc7ab4a772500cac939910cb4ab61599ee4
parent8b95d5e0bf00d9d0098579d29fd6bb9322071879
asyncio, tulip issue 196: ProactorIocp._register() now registers the overlapped
in the _cache dictionary, even if we already got the result. We need to keep a
reference to the overlapped object, otherwise the memory may be reused and
GetQueuedCompletionStatus() may use random bytes and behaves badly.

There is still a hack for ConnectNamedPipe(): the overlapped object is not
register into _cache if the overlapped object completed directly.

Log also an error in debug mode in ProactorIocp._loop() if we get an unexpected
event.

Add a protection in ProactorIocp.close() to avoid blocking, even if it should
not happen. I still don't understand exactly why some the completion of some
overlapped objects are not notified.
Lib/asyncio/windows_events.py