MySQL 8.0.32
Source Code Documentation
MutexDebug< Mutex >::Context Struct Reference

For passing context to SyncDebug. More...

#include <sync0policy.h>

Inheritance diagram for MutexDebug< Mutex >::Context:
[legend]

Public Member Functions

 Context ()
 Constructor. More...
 
 Context (latch_id_t id)
 Create the context for SyncDebug. More...
 
void locked (const Mutex *mutex, const char *filename, ulint line) 1
 Set to locked state. More...
 
void release () 1
 Reset to unlock state. More...
 
std::string to_string () const override 1
 Print information about the latch. More...
 
virtual std::string locked_from () const override
 
- Public Member Functions inherited from latch_t
 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
 
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

const Mutex * m_mutex
 Mutex to check for lock order violation. More...
 
const char * m_filename
 Filename from where enter was called. More...
 
ulint m_line
 Line number in filename. More...
 
std::thread::id m_thread_id
 Thread ID of the thread that own(ed) the mutex. More...
 
- Public Attributes inherited from latch_t
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

template<typename Mutex>
struct MutexDebug< Mutex >::Context

For passing context to SyncDebug.

Constructor & Destructor Documentation

◆ Context() [1/2]

template<typename Mutex >
MutexDebug< Mutex >::Context::Context ( )
inline

Constructor.

◆ Context() [2/2]

template<typename Mutex >
MutexDebug< Mutex >::Context::Context ( latch_id_t  id)
inline

Create the context for SyncDebug.

Parameters
[in]idID of the latch to track

Member Function Documentation

◆ locked()

template<typename Mutex >
void MutexDebug< Mutex >::Context::locked ( const Mutex *  mutex,
const char *  filename,
ulint  line 
)
inline

Set to locked state.

Parameters
[in]mutexThe mutex to acquire
[in]filenameFile name from where to acquire
[in]lineLine number in filename

◆ locked_from()

template<typename Mutex >
virtual std::string MutexDebug< Mutex >::Context::locked_from ( ) const
inlineoverridevirtual
Returns
the name of the file and line number in the file from where the mutex was acquired "filename:line"

Implements latch_t.

◆ release()

template<typename Mutex >
void MutexDebug< Mutex >::Context::release ( )
inline

Reset to unlock state.

◆ to_string()

template<typename Mutex >
std::string MutexDebug< Mutex >::Context::to_string ( ) const
inlineoverridevirtual

Print information about the latch.

Returns
the string representation

Implements latch_t.

Member Data Documentation

◆ m_filename

template<typename Mutex >
const char* MutexDebug< Mutex >::Context::m_filename

Filename from where enter was called.

◆ m_line

template<typename Mutex >
ulint MutexDebug< Mutex >::Context::m_line

Line number in filename.

◆ m_mutex

template<typename Mutex >
const Mutex* MutexDebug< Mutex >::Context::m_mutex

Mutex to check for lock order violation.

◆ m_thread_id

template<typename Mutex >
std::thread::id MutexDebug< Mutex >::Context::m_thread_id

Thread ID of the thread that own(ed) the mutex.


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