Ensure that the first waiter will wake up.
(self)
| 142 | raise RuntimeError('Lock is not acquired.') |
| 143 | |
| 144 | def _wake_up_first(self): |
| 145 | """Ensure that the first waiter will wake up.""" |
| 146 | if not self._waiters: |
| 147 | return |
| 148 | try: |
| 149 | fut = next(iter(self._waiters)) |
| 150 | except StopIteration: |
| 151 | return |
| 152 | |
| 153 | # .done() means that the waiter is already set to wake up. |
| 154 | if not fut.done(): |
| 155 | fut.set_result(True) |
| 156 | |
| 157 | |
| 158 | class Event(mixins._LoopBoundMixin): |
no test coverage detected