From 966b88292cd9e5332b99477f9b652880b2379121 Mon Sep 17 00:00:00 2001 From: Ian OHara Date: Mon, 24 Feb 2025 10:53:24 -0800 Subject: [PATCH] fix: daemonize process queue threads so we get clean close even if signals are missed. --- software/control/core/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/software/control/core/core.py b/software/control/core/core.py index d8462c99..77f8d4c5 100644 --- a/software/control/core/core.py +++ b/software/control/core/core.py @@ -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 @@ -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): @@ -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):