Skip to content

Commit

Permalink
fix: daemonize process queue threads so we get clean close even if si…
Browse files Browse the repository at this point in the history
…gnals are missed.
  • Loading branch information
ianohara committed Feb 24, 2025
1 parent 8065131 commit 966b882
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions software/control/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def __init__(self, image_format=Acquisition.IMAGE_FORMAT):
self.queue = Queue(10) # max 10 items in the queue
self.image_lock = Lock()
self.stop_signal_received = False
self.thread = Thread(target=self.process_queue)
self.thread = Thread(target=self.process_queue, daemon=True)
self.thread.start()
self.counter = 0
self.recording_start_time = 0
Expand Down Expand Up @@ -324,7 +324,7 @@ def __init__(self, base_path, image_format="bmp"):
self.queue = Queue(100) # max 100 items in the queue
self.image_lock = Lock()
self.stop_signal_received = False
self.thread = Thread(target=self.process_queue)
self.thread = Thread(target=self.process_queue, daemon=True)
self.thread.start()

def process_queue(self):
Expand Down Expand Up @@ -381,7 +381,7 @@ def __init__(self):
self.queue = Queue(10) # max 10 items in the queue
self.image_lock = Lock()
self.stop_signal_received = False
self.thread = Thread(target=self.process_queue)
self.thread = Thread(target=self.process_queue, daemon=True)
self.thread.start()

def process_queue(self):
Expand Down

0 comments on commit 966b882

Please sign in to comment.