MySQL 9.1.0
Source Code Documentation
latch_t Struct Referenceabstract

All (ordered) latches, used in debugging, must derive from this class. More...

#include <sync0types.h>

Inheritance diagram for latch_t:
[legend]

Public Member Functions

 latch_t (latch_id_t id=LATCH_ID_NONE) 1
 Constructor. More...
 
latch_toperator= (const latch_t &)=default
 
virtual ~latch_t () 1=default
 Destructor. More...
 
latch_id_t get_id () const
 
bool is_rw_lock () const 1
 
virtual std::string to_string () const =0
 Print the latch context. More...
 
virtual std::string locked_from () const =0
 
latch_level_t get_level () const 1
 
bool is_temp_fsp () const 1
 
void set_temp_fsp () 1
 Set the temporary tablespace flag. More...
 
const char * get_name () const 1
 

Public Attributes

latch_id_t m_id
 Latch ID. More...
 
bool m_rw_lock
 true if it is a rw-lock. More...
 
bool m_temp_fsp
 true if it is an temporary space latch More...
 

Detailed Description

All (ordered) latches, used in debugging, must derive from this class.

Constructor & Destructor Documentation

◆ latch_t()

latch_t::latch_t ( latch_id_t  id = LATCH_ID_NONE)
inlineexplicit

Constructor.

Parameters
[in]idThe latch ID

◆ ~latch_t()

virtual latch_t::~latch_t ( )
virtualdefault

Destructor.

Member Function Documentation

◆ get_id()

latch_id_t latch_t::get_id ( ) const
inline
Returns
the latch ID

◆ get_level()

latch_level_t latch_t::get_level ( ) const
inline
Returns
the latch level

◆ get_name()

const char * latch_t::get_name ( ) const
inline
Returns
the latch name, m_id must be set

◆ is_rw_lock()

bool latch_t::is_rw_lock ( ) const
inline
Returns
true if it is a rw-lock

◆ is_temp_fsp()

bool latch_t::is_temp_fsp ( ) const
inline
Returns
true if the latch is for a temporary file space

◆ locked_from()

virtual std::string latch_t::locked_from ( ) const
pure virtual
Returns
"filename:line" from where the latch was last locked

Implemented in MutexDebug< Mutex >::Context, and rw_lock_t.

◆ operator=()

latch_t & latch_t::operator= ( const latch_t )
default

◆ set_temp_fsp()

void latch_t::set_temp_fsp ( )
inline

Set the temporary tablespace flag.

The latch order constraints are different for intrinsic tables. We don't always acquire the index->lock. We need to figure out the context and add some special rules during the checks.

◆ to_string()

virtual std::string latch_t::to_string ( ) const
pure virtual

Print the latch context.

Returns
the string representation

Implemented in rw_lock_t, and MutexDebug< Mutex >::Context.

Member Data Documentation

◆ m_id

latch_id_t latch_t::m_id

Latch ID.

◆ m_rw_lock

bool latch_t::m_rw_lock

true if it is a rw-lock.

In debug mode, rw_lock_t derives from this class and sets this variable.

◆ m_temp_fsp

bool latch_t::m_temp_fsp

true if it is an temporary space latch


The documentation for this struct was generated from the following file: