summaryrefslogtreecommitdiff
path: root/include/libcamera/fence.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libcamera/fence.h')
-rw-r--r--include/libcamera/fence.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/libcamera/fence.h b/include/libcamera/fence.h
new file mode 100644
index 00000000..c0c916c2
--- /dev/null
+++ b/include/libcamera/fence.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2021, Google Inc.
+ *
+ * internal/fence.h - Synchronization fence
+ */
+
+#pragma once
+
+#include <libcamera/base/class.h>
+#include <libcamera/base/unique_fd.h>
+
+namespace libcamera {
+
+class Fence
+{
+public:
+ Fence(UniqueFD fd);
+
+ bool isValid() const { return fd_.isValid(); }
+ const UniqueFD &fd() const { return fd_; }
+
+ UniqueFD release() { return std::move(fd_); }
+
+private:
+ LIBCAMERA_DISABLE_COPY_AND_MOVE(Fence)
+
+ UniqueFD fd_;
+};
+
+} /* namespace libcamera */