diff -r 4f56142e7497 -r 2a44b9649212 scheduler.py --- a/scheduler.py Fri Jan 26 19:04:04 2018 +0000 +++ b/scheduler.py Sat Jan 27 12:19:39 2018 +0000 @@ -73,11 +73,14 @@ def _insert(self, ev): if not self._list: + #logger.debug("Insert first") self._list=ev elif ev0: + logger.debug("Scheduler waiting %d seconds" % (timeout or (-1))) self._cond.wait(timeout) now = time.monotonic() + logger.debug("Scheduler timed out") + while self._list and self._list.when <= now: ev=self._list logger.debug("Scheduler activating %s" % (ev.name or "(unknown)")) @@ -136,5 +143,6 @@ # cond has to be acquired on entry! def wait_until(self, when, cond, name=None): + logger.debug("Scheduling '%s' at %d" % (name, when)) self._wait(ScheduledEvent(when, cond, name))