summaryrefslogtreecommitdiff
path: root/src/libcamera/bound_method.cpp
blob: d89f84c03f4d15f6c10fc36ae93a5f761b19ffb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * bound_method.cpp - Method bind and invocation
 */

#include <libcamera/bound_method.h>

#include "message.h"
#include "thread.h"
#include "utils.h"

namespace libcamera {

void BoundMethodBase::activatePack(void *pack)
{
	if (Thread::current() == object_->thread()) {
		invokePack(pack);
	} else {
		std::unique_ptr<Message> msg =
			utils::make_unique<InvokeMessage>(this, pack);
		object_->postMessage(std::move(msg));
	}
}

} /* namespace libcamera */