]> granicus.if.org Git - python/commit
asyncio: sync with Tulip
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 24 Jul 2014 22:54:53 +0000 (00:54 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 24 Jul 2014 22:54:53 +0000 (00:54 +0200)
commitfea6a100dc51012cb0187374ad31de330ebc0035
treed08433104303f217e1e3798fb43b398cec09b07d
parent92639cce354ecb52db6179c3edcf90012096f345
asyncio: sync with Tulip

Improve stability of the proactor event loop, especially operations on
overlapped objects:

* Tulip issue 195: Don't call UnregisterWait() twice if a _WaitHandleFuture is
  cancelled twice to fix a crash.
* IocpProactor.close(): cancel futures to cancel overlapped operations, instead
  of cancelling directly overlapped operations. Future objects may not call
  ov.cancel() if the future was cancelled or if the overlapped was already
  cancelled. The cancel() method of the future may also catch exceptions. Log
  also errors on cancellation.
* tests: rename "f" to "fut"
* Add a __repr__() method to IocpProactor
* Add a destructor to IocpProactor which closes it
* _OverlappedFuture.cancel() doesn't cancel the overlapped anymore if it is
  done: if it is already cancelled or completed. Log also an error if the
  cancellation failed.
* Add the address of the overlapped object in repr(_OverlappedFuture)
* _OverlappedFuture truncates the source traceback to hide the call to the
  parent constructor (useless in debug).
Lib/asyncio/windows_events.py
Lib/test/test_asyncio/test_windows_events.py