Explicitally use gevent for camera stream thread
This commit is contained in:
parent
78edb695bf
commit
de5894964e
1 changed files with 2 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
|
import gevent
|
||||||
|
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
@ -266,9 +267,7 @@ class BaseCamera(metaclass=ABCMeta):
|
||||||
if not self.stream_active:
|
if not self.stream_active:
|
||||||
# Spawn a greenlet to handle stream
|
# Spawn a greenlet to handle stream
|
||||||
# start background frame thread
|
# start background frame thread
|
||||||
self.thread = threading.Thread(target=self._thread)
|
self.thread = gevent.spawn(self._thread)
|
||||||
self.thread.daemon = True
|
|
||||||
self.thread.start()
|
|
||||||
|
|
||||||
# wait until frames are available
|
# wait until frames are available
|
||||||
logging.info("Waiting for frames")
|
logging.info("Waiting for frames")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue