5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_
8 #include <condition_variable>
13 #include "flutter/fml/closure.h"
14 #include "flutter/fml/macros.h"
25 using WaitSet = std::vector<std::shared_ptr<WaitSetEntry>>;
35 bool AddFence(vk::UniqueFence fence,
const fml::closure& callback);
40 std::weak_ptr<DeviceHolderVK> device_holder_;
41 std::unique_ptr<std::thread> waiter_thread_;
42 std::mutex wait_set_mutex_;
43 std::condition_variable wait_set_cv_;
45 bool terminate_ =
false;
47 explicit FenceWaiterVK(std::weak_ptr<DeviceHolderVK> device_holder);
52 void WaitUntilEmpty();
61 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_FENCE_WAITER_VK_H_