Android-cuttlefish cvd tool
Public Member Functions | Private Attributes | List of all members
cuttlefish::DataViewer::DeadlockProtector Class Reference

Public Member Functions

 DeadlockProtector (const DataViewer &dv)
 
 ~DeadlockProtector ()
 
 DeadlockProtector (const DeadlockProtector &)=delete
 
 DeadlockProtector (DeadlockProtector &&)=delete
 

Private Attributes

std::mutex & mtx_
 
std::unordered_map< std::thread::id, bool > & map_
 

Detailed Description

Utility class to prevent deadlocks due to function reentry.

It checks that the current thread doesn't already hold the file lock, aborting the program when it detects a deadlock could occur.

Constructor & Destructor Documentation

◆ DeadlockProtector() [1/3]

cuttlefish::DataViewer::DeadlockProtector::DeadlockProtector ( const DataViewer dv)

◆ ~DeadlockProtector()

cuttlefish::DataViewer::DeadlockProtector::~DeadlockProtector ( )

◆ DeadlockProtector() [2/3]

cuttlefish::DataViewer::DeadlockProtector::DeadlockProtector ( const DeadlockProtector )
delete

◆ DeadlockProtector() [3/3]

cuttlefish::DataViewer::DeadlockProtector::DeadlockProtector ( DeadlockProtector &&  )
delete

Member Data Documentation

◆ map_

std::unordered_map<std::thread::id, bool>& cuttlefish::DataViewer::DeadlockProtector::map_
private

◆ mtx_

std::mutex& cuttlefish::DataViewer::DeadlockProtector::mtx_
private

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