18 #ifndef MIR_GRAPHICS_ANDROID_SYNC_FENCE_H_
19 #define MIR_GRAPHICS_ANDROID_SYNC_FENCE_H_
34 virtual ~SyncFileOps() =
default;
35 virtual int ioctl(
int,
int,
void*) = 0;
36 virtual int dup(
int) = 0;
37 virtual int close(
int) = 0;
40 class RealSyncFileOps :
public SyncFileOps
43 int ioctl(
int fd,
int req,
void* dat);
48 class SyncFence :
public Fence
51 SyncFence(std::shared_ptr<SyncFileOps>
const&,
int fd);
52 ~SyncFence() noexcept;
55 void merge_with(NativeFence& merge_fd);
56 NativeFence copy_native_handle() const;
59 SyncFence(SyncFence const&) = delete;
60 SyncFence& operator=(SyncFence const&) = delete;
63 std::shared_ptr<SyncFileOps> const ops;
65 int const infinite_timeout = -1;