summaryrefslogtreecommitdiff
path: root/src/libcamera/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-18 03:44:49 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-20 13:35:59 +0200
commit1d929967b7d5623ec49f0bbed3abe4fea480011e (patch)
tree5d37ad5cde2a0e2391c0f5dbe3559833172847a0 /src/libcamera/include
parenta39b91d44edfc737ddb26003f663ba26ee14e785 (diff)
libcamera: thread: Add a method to return the ID of the current thread
The current thread ID is useful when logging message to debug concurrency issues. Add a method to retrieve it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r--src/libcamera/include/thread.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcamera/include/thread.h b/src/libcamera/include/thread.h
index 37edd4f5..819a9879 100644
--- a/src/libcamera/include/thread.h
+++ b/src/libcamera/include/thread.h
@@ -9,6 +9,7 @@
#include <memory>
#include <mutex>
+#include <sys/types.h>
#include <thread>
#include <libcamera/signal.h>
@@ -39,6 +40,7 @@ public:
Signal<Thread *> finished;
static Thread *current();
+ static pid_t currentId();
EventDispatcher *eventDispatcher();
void setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher);