(self)
| 83 | self._loop_timer = libev.Timer(self._loop, self._on_loop_timer) |
| 84 | |
| 85 | def maybe_start(self): |
| 86 | should_start = False |
| 87 | with self._lock: |
| 88 | if not self._started: |
| 89 | log.debug("Starting libev event loop") |
| 90 | self._started = True |
| 91 | should_start = True |
| 92 | |
| 93 | if should_start: |
| 94 | with self._lock_thread: |
| 95 | if not self._shutdown: |
| 96 | self._thread = Thread(target=self._run_loop, name="event_loop") |
| 97 | self._thread.daemon = True |
| 98 | self._thread.start() |
| 99 | |
| 100 | self._notifier.send() |
| 101 | |
| 102 | def _run_loop(self): |
| 103 | while True: |