From de5894964e6ad5d0439cf8bd03c39e041575fd67 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 27 Mar 2020 16:40:06 +0000 Subject: [PATCH] Explicitally use gevent for camera stream thread --- openflexure_microscope/camera/base.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openflexure_microscope/camera/base.py b/openflexure_microscope/camera/base.py index 2d1e930a..821b133d 100644 --- a/openflexure_microscope/camera/base.py +++ b/openflexure_microscope/camera/base.py @@ -7,6 +7,7 @@ import datetime import logging import threading +import gevent from abc import ABCMeta, abstractmethod from collections import OrderedDict @@ -266,9 +267,7 @@ class BaseCamera(metaclass=ABCMeta): if not self.stream_active: # Spawn a greenlet to handle stream # start background frame thread - self.thread = threading.Thread(target=self._thread) - self.thread.daemon = True - self.thread.start() + self.thread = gevent.spawn(self._thread) # wait until frames are available logging.info("Waiting for frames")