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>
This commit is contained in:
committed by
Laurent Pinchart
parent
59002a9e9d
commit
923cf7f40a
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <condition_variable>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
@@ -154,7 +153,7 @@ private:
|
||||
PostProcessor *postProcessor_;
|
||||
|
||||
libcamera::Mutex mutex_;
|
||||
std::condition_variable cv_;
|
||||
libcamera::ConditionVariable cv_;
|
||||
|
||||
std::queue<Camera3RequestDescriptor::StreamBuffer *> requests_;
|
||||
State state_ = State::Stopped;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <libcamera/base/thread.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <list>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/types.h>
|
||||
@@ -158,7 +157,7 @@ private:
|
||||
|
||||
std::atomic<EventDispatcher *> dispatcher_;
|
||||
|
||||
std::condition_variable cv_;
|
||||
ConditionVariable cv_;
|
||||
std::atomic<bool> exit_;
|
||||
int exitCode_;
|
||||
|
||||
@@ -205,6 +204,11 @@ ThreadData *ThreadData::current()
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* \typedef ConditionVariable
|
||||
* \brief An alias for std::condition_variable
|
||||
*/
|
||||
|
||||
/**
|
||||
* \typedef Mutex
|
||||
* \brief An alias for std::mutex
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <libcamera/camera_manager.h>
|
||||
|
||||
#include <condition_variable>
|
||||
#include <map>
|
||||
|
||||
#include <libcamera/camera.h>
|
||||
@@ -63,7 +62,7 @@ private:
|
||||
void createPipelineHandlers();
|
||||
void cleanup();
|
||||
|
||||
std::condition_variable cv_;
|
||||
ConditionVariable cv_;
|
||||
bool initialized_;
|
||||
int status_;
|
||||
|
||||
|
||||
@@ -82,6 +82,6 @@ private:
|
||||
int efd_;
|
||||
|
||||
libcamera::Mutex bufferMutex_;
|
||||
std::condition_variable bufferCV_;
|
||||
libcamera::ConditionVariable bufferCV_;
|
||||
unsigned int bufferAvailableCount_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user