summaryrefslogtreecommitdiff
path: root/test/public-api.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-11-15 19:01:56 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-12-11 17:53:40 +0100
commit8ac8ecb1e12f18891369bb26693bc3a0a7d6ff94 (patch)
tree57d71939ed2b2cca0baca6bd6606e7776bfd1b78 /test/public-api.cpp
parentdb37335ee0ee78f7e5562a9617c1b4f17451fc3a (diff)
libcamera: fence: Introduce Fence
Introduce a Fence class which models a synchronization primitive that allows to notify the availability of a resource. The Fence is modeled as a wrapper of a UniqueFD instance where read events are used to signal the Fence. The class can be later extended to support additional signalling mechanisms. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/public-api.cpp')
0 files changed, 0 insertions, 0 deletions
#include <libcamera/timer.h> #include "test.h" #include "thread.h" using namespace std; using namespace libcamera; class TimeoutHandler : public Object { public: TimeoutHandler() : timer_(this), timeout_(false) { timer_.timeout.connect(this, &TimeoutHandler::timeoutHandler); timer_.start(100); } void restart() { timeout_ = false; timer_.start(100); } bool timeout() const { return timeout_; } private: void timeoutHandler(Timer *timer) { timeout_ = true; } Timer timer_; bool timeout_; }; class TimerThreadTest : public Test { protected: int init() { thread_.start(); timeout_.moveToThread(&thread_);