Fix locking on PreciseRunner.stop()

This fix only applies to when stream is a ReadWriteStream
pull/10/head
Matthew D. Scholefield 2018-04-18 22:24:54 -05:00
parent a3274b8d33
commit 09c728fb33
1 changed files with 2 additions and 0 deletions

View File

@ -151,6 +151,8 @@ class PreciseRunner(object):
"""Stop listening and close stream"""
if self.thread:
self.running = False
if isinstance(self.stream, ReadWriteStream):
self.stream.write(b'\0' * self.chunk_size)
self.thread.join()
self.thread = None