| 98 | """Subclass of Future which represents a wait handle.""" |
| 99 | |
| 100 | def __init__(self, ov, handle, wait_handle, *, loop=None): |
| 101 | super().__init__(loop=loop) |
| 102 | if self._source_traceback: |
| 103 | del self._source_traceback[-1] |
| 104 | # Keep a reference to the Overlapped object to keep it alive until the |
| 105 | # wait is unregistered |
| 106 | self._ov = ov |
| 107 | self._handle = handle |
| 108 | self._wait_handle = wait_handle |
| 109 | |
| 110 | # Should we call UnregisterWaitEx() if the wait completes |
| 111 | # or is cancelled? |
| 112 | self._registered = True |
| 113 | |
| 114 | def _poll(self): |
| 115 | # non-blocking wait: use a timeout of 0 millisecond |