summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-12-01 16:53:37 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-01 13:46:36 +0200
commit923cf7f40a7f1875874384b30a7c8dcb1f23467a (patch)
tree63973cb65804a5b53ed6c8855fed289dea6dfb07 /include
parent59002a9e9d84417197999391c7d8c6af620fc1fb (diff)
libcamera: base: Introduce ConditionVariable
ConditionVariable is alias to std::condition_variable. This replaces std::condition_variable with the ConditionVariable. It enables replacing ConditionVariable implementation easily in the following patches. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/base/semaphore.h4
-rw-r--r--include/libcamera/base/thread.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h
index ae87d319..ec05fad3 100644
--- a/include/libcamera/base/semaphore.h
+++ b/include/libcamera/base/semaphore.h
@@ -7,8 +7,6 @@
#pragma once
-#include <condition_variable>
-
#include <libcamera/base/private.h>
#include <libcamera/base/thread.h>
@@ -26,7 +24,7 @@ public:
private:
Mutex mutex_;
- std::condition_variable cv_;
+ ConditionVariable cv_;
unsigned int available_;
};
diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h
index 32ebc80a..1ebf8363 100644
--- a/include/libcamera/base/thread.h
+++ b/include/libcamera/base/thread.h
@@ -7,6 +7,7 @@
#pragma once
+#include <condition_variable>
#include <memory>
#include <mutex>
#include <sys/types.h>
@@ -26,6 +27,7 @@ class Object;
class ThreadData;
class ThreadMain;
+using ConditionVariable = std::condition_variable;
using Mutex = std::mutex;
using MutexLocker = std::unique_lock<std::mutex>;