| 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 27 of file fence_waiter_vk.h.

## Constructor & Destructor Documentation

## ◆ ~FenceWaiterVK()

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

Definition at line 60 of file fence_waiter_vk.cc.

60 {
61 Terminate();
62 waiter_thread_->join();
63 }

References Terminate().

## Member Function Documentation

## ◆ AddFence()

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

Definition at line 65 of file fence_waiter_vk.cc.

66 {
67 if (!fence || !callback) {
68 return false;
69 }
70 {
71 // Maintain the invariant that terminate_ is accessed only under the lock.
72 std::scoped_lock lock(wait_set_mutex_);
73 if (terminate_) {
74 return false;
75 }
76 wait_set_.emplace_back(WaitSetEntry::Create(std::move(fence), callback));
77 }
78 wait_set_cv_.notify_one();
79 return true;
80 }

References impeller::WaitSetEntry::Create().

## ◆ IsValid()

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

## ◆ Terminate()

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

Definition at line 207 of file fence_waiter_vk.cc.

207 {
208 {
209 std::scoped_lock lock(wait_set_mutex_);
210 terminate_ = true;
211 }
212 wait_set_cv_.notify_one();
213 }

Referenced by ~FenceWaiterVK().

## Friends And Related Function Documentation

## ◆ ContextVK

friend class ContextVK
| friend

Definition at line 38 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:207