| Flutter Impeller |

Public Member Functions | Friends | List of all members
impeller::FenceWaiterVK Class Reference

`#include <fence_waiter_vk.h>`

## Public Member Functions
| ~FenceWaiterVK ()
bool | IsValid () const
void | Terminate ()
bool | AddFence (vk::UniqueFence fence, const fml::closure &callback)

## Friends
class | ContextVK

## Detailed Description

Definition at line 26 of file fence_waiter_vk.h.

## Constructor & Destructor Documentation

## ◆ ~FenceWaiterVK()

impeller::FenceWaiterVK::~FenceWaiterVK | ( |  | ) |

Definition at line 54 of file fence_waiter_vk.cc.

54 {
55 Terminate();
56 waiter_thread_->join();
57 }

References Terminate().

## Member Function Documentation

## ◆ AddFence()

bool impeller::FenceWaiterVK::AddFence | ( | vk::UniqueFence | fence,
|  | const fml::closure & | callback
| ) |  |

Definition at line 59 of file fence_waiter_vk.cc.

60 {
61 TRACE_EVENT0("flutter", "FenceWaiterVK::AddFence");
62 if (!fence || !callback) {
63 return false;
64 }
65 {
66 // Maintain the invariant that terminate_ is accessed only under the lock.
67 std::scoped_lock lock(wait_set_mutex_);
68 if (terminate_) {
69 return false;
70 }
71 wait_set_.emplace_back(WaitSetEntry::Create(std::move(fence), callback));
72 }
73 wait_set_cv_.notify_one();
74 return true;
75 }

References impeller::WaitSetEntry::Create().

## ◆ IsValid()

bool impeller::FenceWaiterVK::IsValid | ( |  | ) | const

## ◆ Terminate()

void impeller::FenceWaiterVK::Terminate | ( |  | ) |

Definition at line 202 of file fence_waiter_vk.cc.

202 {
203 {
204 std::scoped_lock lock(wait_set_mutex_);
205 terminate_ = true;
206 }
207 wait_set_cv_.notify_one();
208 }

Referenced by ~FenceWaiterVK().

## Friends And Related Function Documentation

## ◆ ContextVK

friend class ContextVK
| friend

Definition at line 37 of file fence_waiter_vk.h.

The documentation for this class was generated from the following files:

- impeller/renderer/backend/vulkan/fence_waiter_vk.h
- impeller/renderer/backend/vulkan/fence_waiter_vk.cc

impeller::WaitSetEntry::Create
static std::shared_ptr< WaitSetEntry > Create(vk::UniqueFence p_fence, const fml::closure &p_callback)
Definition: fence_waiter_vk.cc:20
impeller::FenceWaiterVK::Terminate
void Terminate()
Definition: fence_waiter_vk.cc:202