Flutter Impeller
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 23 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 }

References Terminate().

Member Function Documentation

◆ AddFence()

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

Definition at line 64 of file fence_waiter_vk.cc.

65  {
66  if (!fence || !callback) {
67  return false;
68  }
69  {
70  // Maintain the invariant that terminate_ is accessed only under the lock.
71  std::scoped_lock lock(wait_set_mutex_);
72  if (terminate_) {
73  return false;
74  }
75  wait_set_.emplace_back(WaitSetEntry::Create(std::move(fence), callback));
76  }
77  wait_set_cv_.notify_one();
78  return true;
79 }
static std::shared_ptr< WaitSetEntry > Create(vk::UniqueFence p_fence, const fml::closure &p_callback)

References impeller::WaitSetEntry::Create().

◆ IsValid()

bool impeller::FenceWaiterVK::IsValid ( ) const

◆ Terminate()

void impeller::FenceWaiterVK::Terminate ( )

Definition at line 206 of file fence_waiter_vk.cc.

206  {
207  {
208  std::scoped_lock lock(wait_set_mutex_);
209  if (terminate_) {
210  return;
211  }
212  terminate_ = true;
213  }
214  wait_set_cv_.notify_one();
215  waiter_thread_->join();
216 }

Referenced by ~FenceWaiterVK().

Friends And Related Function Documentation

◆ ContextVK

friend class ContextVK
friend

Definition at line 34 of file fence_waiter_vk.h.


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