MySQL 8.0.32
Source Code Documentation
MutexDebug< Mutex > Class Template Reference

#include <sync0policy.h>

Inheritance diagram for MutexDebug< Mutex >:
[legend]

Classes

struct  Context
 For passing context to SyncDebug. More...
 

Public Member Functions

 MutexDebug ()
 Constructor. More...
 
virtual ~MutexDebug ()=default
 
void destroy () 1
 Mutex is being destroyed. More...
 
void init (latch_id_t id) 1
 Called when the mutex is "created". More...
 
void enter (const Mutex *mutex, const char *filename, ulint line) 1
 Called when an attempt is made to lock the mutex. More...
 
void locked (const Mutex *mutex, const char *filename, ulint line) 1
 Called when the mutex is locked. More...
 
void release (const Mutex *mutex) 1
 Called when the mutex is released. More...
 
bool is_owned () const 1
 
const char * get_enter_filename () const 1
 
ulint get_enter_line () const 1
 
std::thread::id get_thread_id () const 1
 

Public Attributes

uint32_t m_magic_n
 Magic number to check for memory corruption. More...
 
Context m_context
 Latch state of the mutex owner. More...
 

Constructor & Destructor Documentation

◆ MutexDebug()

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

Constructor.

◆ ~MutexDebug()

template<typename Mutex >
virtual MutexDebug< Mutex >::~MutexDebug ( )
virtualdefault

Member Function Documentation

◆ destroy()

template<typename Mutex >
void MutexDebug< Mutex >::destroy ( )
inline

Mutex is being destroyed.

◆ enter()

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

Called when an attempt is made to lock the mutex.

Parameters
[in]mutexMutex instance to be locked
[in]filenameFilename from where it was called
[in]lineLine number from where it was called

◆ get_enter_filename()

template<typename Mutex >
const char * MutexDebug< Mutex >::get_enter_filename ( ) const
inline
Returns
the name of the file from the mutex was acquired

◆ get_enter_line()

template<typename Mutex >
ulint MutexDebug< Mutex >::get_enter_line ( ) const
inline
Returns
the name of the file from the mutex was acquired

◆ get_thread_id()

template<typename Mutex >
std::thread::id MutexDebug< Mutex >::get_thread_id ( ) const
inline
Returns
id of the thread that was trying to acquire the mutex

◆ init()

template<typename Mutex >
void MutexDebug< Mutex >::init ( latch_id_t  id)

Called when the mutex is "created".

Note: Not from the constructor but when the mutex is initialised.

Parameters
[in]idMutex ID

◆ is_owned()

template<typename Mutex >
bool MutexDebug< Mutex >::is_owned ( ) const
inline
Returns
true if thread owns the mutex

◆ locked()

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

Called when the mutex is locked.

Parameters
[in]mutexMutex instance that was locked
[in]filenameFilename from where it was called
[in]lineLine number from where it was called

◆ release()

template<typename Mutex >
void MutexDebug< Mutex >::release ( const Mutex *  mutex)

Called when the mutex is released.

Parameters
[in]mutexMutex that was released

Member Data Documentation

◆ m_context

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

Latch state of the mutex owner.

◆ m_magic_n

template<typename Mutex >
uint32_t MutexDebug< Mutex >::m_magic_n

Magic number to check for memory corruption.


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