diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-28 05:31:12 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-29 16:41:54 +0200 |
commit | 3d75cc1bd209cf1de909ce5c8c9cec16789708f6 (patch) | |
tree | 5e23464cd2bbbefaaa38cbf900c809d81754ffa8 /src/libcamera/object.cpp | |
parent | df2518b2a3451ad73ebddce056b68edb98ab0f7c (diff) |
libcamera: bound_method: Support connection types
Support all connection types in the BoundMethodBase::activePack()
method. To support this, add a semaphore to the InvokeMessage to signal
delivery.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/object.cpp')
-rw-r--r-- | src/libcamera/object.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libcamera/object.cpp b/src/libcamera/object.cpp index 98aa0af2..b0818f9a 100644 --- a/src/libcamera/object.cpp +++ b/src/libcamera/object.cpp @@ -13,6 +13,7 @@ #include "log.h" #include "message.h" +#include "semaphore.h" #include "thread.h" #include "utils.h" @@ -123,7 +124,12 @@ void Object::message(Message *msg) switch (msg->type()) { case Message::InvokeMessage: { InvokeMessage *iMsg = static_cast<InvokeMessage *>(msg); + Semaphore *semaphore = iMsg->semaphore(); iMsg->invoke(); + + if (semaphore) + semaphore->release(); + break; } @@ -150,7 +156,7 @@ void Object::message(Message *msg) void Object::invokeMethod(BoundMethodBase *method, void *args) { std::unique_ptr<Message> msg = - utils::make_unique<InvokeMessage>(method, args, true); + utils::make_unique<InvokeMessage>(method, args, nullptr, true); postMessage(std::move(msg)); } |