| 111 self._cond.wait(timeout) |
111 self._cond.wait(timeout) |
| 112 now = time.monotonic() |
112 now = time.monotonic() |
| 113 |
113 |
| 114 while self._list and self._list.when <= now: |
114 while self._list and self._list.when <= now: |
| 115 ev=self._list |
115 ev=self._list |
| 116 logger.debug("Scheduling event %s" % (ev.name or "(unknown)")) |
116 logger.debug("Scheduler activating %s" % (ev.name or "(unknown)")) |
| 117 # We are only allowed to remove ev from list when ev.cond allows |
117 # We are only allowed to remove ev from list when ev.cond allows |
| 118 with ev.cond: |
118 with ev.cond: |
| 119 self._list=ev.next |
119 self._list=ev.next |
| 120 ev.unlink() |
120 ev.unlink() |
| 121 ev.cond.notifyAll() |
121 ev.cond.notifyAll() |