diff options
author | Han-Lin Chen <hanlinchen@chromium.org> | 2024-10-29 08:57:55 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2024-11-28 17:50:55 +0000 |
commit | 4d9db06d669044c0c461a2aed79c85c7fe32a502 (patch) | |
tree | ef4ef979b3146962a632bc44eef43de43444cc32 /include | |
parent | d711a4c015e74c7a77cfeba17b621909385f4494 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/base/thread.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h index 4f33de63..3209d4f7 100644 --- a/include/libcamera/base/thread.h +++ b/include/libcamera/base/thread.h @@ -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); |