MySQL 8.0.40
Source Code Documentation
locksys::Global_exclusive_try_latch Class Reference

A RAII helper which tries to exclusively latch the global_lach in constructor and unlatches it, if needed, during destruction, preventing any other threads from activity within lock_sys for it's entire scope, if owns_lock(). More...

#include <lock0guards.h>

Inheritance diagram for locksys::Global_exclusive_try_latch:
[legend]

Public Member Functions

 Global_exclusive_try_latch (ut::Location location)
 
 ~Global_exclusive_try_latch ()
 
bool owns_lock () const noexcept
 Checks if succeeded to latch the global_latch during construction. More...
 

Private Attributes

bool m_owns_exclusive_global_latch
 Did the constructor succeed to acquire exclusive global lock_sys latch? More...
 

Additional Inherited Members

- Private Member Functions inherited from ut::Non_copyable
 Non_copyable (const Non_copyable &)=delete
 
Non_copyableoperator= (const Non_copyable &)=delete
 
 Non_copyable ()=default
 
 ~Non_copyable ()=default
 

Detailed Description

A RAII helper which tries to exclusively latch the global_lach in constructor and unlatches it, if needed, during destruction, preventing any other threads from activity within lock_sys for it's entire scope, if owns_lock().

Constructor & Destructor Documentation

◆ Global_exclusive_try_latch()

locksys::Global_exclusive_try_latch::Global_exclusive_try_latch ( ut::Location  location)

◆ ~Global_exclusive_try_latch()

locksys::Global_exclusive_try_latch::~Global_exclusive_try_latch ( )

Member Function Documentation

◆ owns_lock()

bool locksys::Global_exclusive_try_latch::owns_lock ( ) const
inlinenoexcept

Checks if succeeded to latch the global_latch during construction.

Returns
true iff the current thread owns (through this instance) the exclusive global lock_sys latch

Member Data Documentation

◆ m_owns_exclusive_global_latch

bool locksys::Global_exclusive_try_latch::m_owns_exclusive_global_latch
private

Did the constructor succeed to acquire exclusive global lock_sys latch?


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