libcamera: add method to set thread affinity
Add method to set thread affinity to Thread class. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Co-developed-by: Harvey Yang <chenghaoyang@chromium.org> Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
d711a4c015
commit
4d9db06d66
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <libcamera/base/message.h>
|
||||
#include <libcamera/base/signal.h>
|
||||
#include <libcamera/base/span.h>
|
||||
#include <libcamera/base/utils.h>
|
||||
|
||||
namespace libcamera {
|
||||
@@ -35,6 +36,8 @@ public:
|
||||
void exit(int code = 0);
|
||||
bool wait(utils::duration duration = utils::duration::max());
|
||||
|
||||
int setThreadAffinity(const Span<const unsigned int> &cpus);
|
||||
|
||||
bool isRunning();
|
||||
|
||||
Signal<> finished;
|
||||
@@ -54,6 +57,8 @@ private:
|
||||
void startThread();
|
||||
void finishThread();
|
||||
|
||||
void setThreadAffinityInternal();
|
||||
|
||||
void postMessage(std::unique_ptr<Message> msg, Object *receiver);
|
||||
void removeMessages(Object *receiver);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user