A context manager that does an ordered acquire of Future conditions.
| 133 | self._decrement_pending_calls() |
| 134 | |
| 135 | class _AcquireFutures(object): |
| 136 | """A context manager that does an ordered acquire of Future conditions.""" |
| 137 | |
| 138 | def __init__(self, futures): |
| 139 | self.futures = sorted(futures, key=id) |
| 140 | |
| 141 | def __enter__(self): |
| 142 | for future in self.futures: |
| 143 | future._condition.acquire() |
| 144 | |
| 145 | def __exit__(self, *args): |
| 146 | for future in self.futures: |
| 147 | future._condition.release() |
| 148 | |
| 149 | def _create_and_install_waiters(fs, return_when): |
| 150 | if return_when == _AS_COMPLETED: |
no outgoing calls
no test coverage detected
searching dependent graphs…