File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ def set_exception(self, exception):
7777 super ().set_exception (exception )
7878 self ._cancel_overlapped ()
7979
80+ def set_result (self , result ):
81+ super ().set_result (result )
82+ self ._ov = None
83+
8084
8185class _WaitHandleFuture (futures .Future ):
8286 """Subclass of Future which represents a wait handle."""
@@ -478,6 +482,13 @@ def _poll(self, timeout=None):
478482 _winapi .CloseHandle (key )
479483 ms = 0
480484 continue
485+
486+ if ov .pending :
487+ # False alarm: the overlapped operation is not completed.
488+ # FIXME: why do we get false alarms?
489+ self ._cache [address ] = (f , ov , obj , callback )
490+ continue
491+
481492 if obj in self ._stopped_serving :
482493 f .cancel ()
483494 elif not f .cancelled ():
@@ -489,11 +500,6 @@ def _poll(self, timeout=None):
489500 else :
490501 f .set_result (value )
491502 self ._results .append (f )
492- # FIXME, tulip issue #196: add _OverlappedFuture.set_result()
493- # method to clear the refrence, don't do it here (f may
494- # by a _WaitHandleFuture). Problem: clearing the reference
495- # in _register() if ov.pedding is False leads to weird bugs.
496- f ._ov = None
497503 ms = 0
498504
499505 def _stop_serving (self , obj ):
You can’t perform that action at this time.
0 commit comments