A context manager that does an ordered acquire of Future conditions.
| 139 | self._decrement_pending_calls() |
| 140 | |
| 141 | class _AcquireFutures(object): |
| 142 | """A context manager that does an ordered acquire of Future conditions.""" |
| 143 | |
| 144 | def __init__(self, futures): |
| 145 | self.futures = sorted(futures, key=id) |
| 146 | |
| 147 | def __enter__(self): |
| 148 | for future in self.futures: |
| 149 | future._condition.acquire() |
| 150 | |
| 151 | def __exit__(self, *args): |
| 152 | for future in self.futures: |
| 153 | future._condition.release() |
| 154 | |
| 155 | def _create_and_install_waiters(fs, return_when): |
| 156 | if return_when == _AS_COMPLETED: |
no outgoing calls
no test coverage detected