libcamera: object: Use bound method activePack() for invokeMethod()

The BoundMethodBase::activatePack() and the internal
Object::invokeMethod() are duplicate implementation of the same
mechanism. Use the former to replace the latter.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-10-28 05:44:14 +02:00
parent 8524e62611
commit 06008b9156
4 changed files with 9 additions and 16 deletions

View File

@@ -48,7 +48,7 @@ namespace libcamera {
* deadlock will occur.
*/
void BoundMethodBase::activatePack(void *pack)
void BoundMethodBase::activatePack(void *pack, bool deleteMethod)
{
ConnectionType type = connectionType_;
if (type == ConnectionTypeAuto) {
@@ -66,7 +66,7 @@ void BoundMethodBase::activatePack(void *pack)
case ConnectionTypeQueued: {
std::unique_ptr<Message> msg =
utils::make_unique<InvokeMessage>(this, pack);
utils::make_unique<InvokeMessage>(this, pack, nullptr, deleteMethod);
object_->postMessage(std::move(msg));
break;
}
@@ -75,7 +75,7 @@ void BoundMethodBase::activatePack(void *pack)
Semaphore semaphore;
std::unique_ptr<Message> msg =
utils::make_unique<InvokeMessage>(this, pack, &semaphore);
utils::make_unique<InvokeMessage>(this, pack, &semaphore, deleteMethod);
object_->postMessage(std::move(msg));
semaphore.acquire();