Fix bug where I'd accidentally override threading.Thread internals

This commit is contained in:
Kristóf Tóth 2019-05-09 15:26:39 +02:00
parent 38c81e0d29
commit 5b79dbff2b

View File

@ -47,14 +47,14 @@ class PipeIOServer(ABC, Thread):
for thread in self._io_threads: for thread in self._io_threads:
thread.start() thread.start()
self._stop_event.wait() self._stop_event.wait()
self._stop() self._stop_threads()
def stop(self): def stop(self):
self._stop_event.set() self._stop_event.set()
if self.is_alive(): if self.is_alive():
self.join() self.join()
def _stop(self): def _stop_threads(self):
for thread in self._io_threads: for thread in self._io_threads:
if thread.is_alive(): if thread.is_alive():
thread.stop() thread.stop()