diff -r 442c558bd632 -r cfcaa5f6ba33 scheduler.py --- a/scheduler.py Mon Jan 22 21:07:34 2018 +0000 +++ b/scheduler.py Mon Jan 22 22:23:01 2018 +0000 @@ -18,17 +18,14 @@ self.cond=cond def __lt__(self, other): - return False - - def __gt__(self, other): - return True + raise NotImplementedError def insert_after(self, ev): if not self.next: ev.prev=self self.next=ev ev.next=None - elif self.next>ev: + elif ev other.when - class TerminableThread(Thread): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -72,13 +66,14 @@ class QueueThread(TerminableThread): def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.daemon = True self._list = None - super().__init__(*args, **kwargs) def _insert(self, ev): if not self._list: self._list=ev - elif self._list > ev: + elif ev