libcamera: bound_method: Define connection type for method invocation
Define an enumeration of connection types to describe the delivery method of signals and method invocation. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
committed by
Laurent Pinchart
parent
66e7c5b774
commit
1e2db0eee7
@@ -11,8 +11,42 @@
|
||||
#include "thread.h"
|
||||
#include "utils.h"
|
||||
|
||||
/**
|
||||
* \file bound_method.h
|
||||
* \brief Method bind and invocation
|
||||
*/
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
/**
|
||||
* \enum ConnectionType
|
||||
* \brief Connection type for asynchronous communication
|
||||
*
|
||||
* This enumeration describes the possible types of asynchronous communication
|
||||
* between a sender and a receiver. It applies to Signal::emit() and
|
||||
* Object::invokeMethod().
|
||||
*
|
||||
* \var ConnectionType::ConnectionTypeAuto
|
||||
* \brief If the sender and the receiver live in the same thread,
|
||||
* ConnectionTypeDirect is used. Otherwise ConnectionTypeQueued is used.
|
||||
*
|
||||
* \var ConnectionType::ConnectionTypeDirect
|
||||
* \brief The receiver is invoked immediately and synchronously in the sender's
|
||||
* thread.
|
||||
*
|
||||
* \var ConnectionType::ConnectionTypeQueued
|
||||
* \brief The receiver is invoked asynchronously in its thread when control
|
||||
* returns to the thread's event loop. The sender proceeds without waiting for
|
||||
* the invocation to complete.
|
||||
*
|
||||
* \var ConnectionType::ConnectionTypeBlocking
|
||||
* \brief The receiver is invoked asynchronously in its thread when control
|
||||
* returns to the thread's event loop. The sender blocks until the receiver
|
||||
* signals the completion of the invocation. This connection type shall not be
|
||||
* used when the sender and receiver live in the same thread, otherwise
|
||||
* deadlock will occur.
|
||||
*/
|
||||
|
||||
void BoundMethodBase::activatePack(void *pack)
|
||||
{
|
||||
if (Thread::current() == object_->thread()) {
|
||||
|
||||
Reference in New Issue
Block a user