diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-08-12 03:35:35 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-08-17 18:32:27 +0300 |
commit | a66e5ca8c61093c5b927bb072c595560fd5d5d38 (patch) | |
tree | 3cf092aaf4e1dafae4093683499bb91ede190248 /src/libcamera/thread.cpp | |
parent | 391b184fc57ddcfdf38d3fd3a32b9acc5e7cc4e0 (diff) |
libcamera: thread: Support dispatching messages to main thread
Threads contain message queues and dispatch queued messages in their
event loop, in Thread::exec(). This mechanism prevents the main thread
from dispatching messages as it doesn't run Thread::exec().
Fix this by moving message dispatching from Thread::exec() to
EventDispatcher::processEvents().
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/thread.cpp')
-rw-r--r-- | src/libcamera/thread.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libcamera/thread.cpp b/src/libcamera/thread.cpp index 6f86e4a9..24422f7b 100644 --- a/src/libcamera/thread.cpp +++ b/src/libcamera/thread.cpp @@ -212,10 +212,8 @@ int Thread::exec() locker.unlock(); - while (!data_->exit_.load(std::memory_order_acquire)) { - dispatchMessages(); + while (!data_->exit_.load(std::memory_order_acquire)) dispatcher->processEvents(); - } locker.lock(); |