MySQL 9.0.0
Source Code Documentation
BlockMutexPolicy< Mutex > Class Template Reference

Track aggregate metrics policy, used by the page mutex. More...

#include <sync0policy.h>

Inheritance diagram for BlockMutexPolicy< Mutex >:
[legend]

Public Types

typedef Mutex MutexType
 
typedef latch_meta_t::CounterType::Count Count
 

Public Member Functions

 BlockMutexPolicy ()
 Default constructor. More...
 
 ~BlockMutexPolicy ()=default
 Destructor. More...
 
void init (const MutexType &mutex, latch_id_t id, const char *filename, uint32_t line) 1
 Called when the mutex is "created". More...
 
void destroy () 1
 Called when the mutex is destroyed. More...
 
void add (uint32_t n_spins, uint32_t n_waits) 1
 Called after a successful mutex acquire. More...
 
void locked (const MutexType &mutex, const char *filename, ulint line) 1
 Called when the mutex is locked. More...
 
void release (const MutexType &mutex) 1
 Called when the mutex is released. More...
 
void enter (const MutexType &mutex, const char *filename, ulint line) 1
 Called when an attempt is made to lock the mutex. More...
 
std::string print () const 1
 Print the information about the latch. More...
 
latch_id_t get_id () const
 
std::string to_string () const
 
- Public Member Functions inherited from MutexDebug< Mutex >
 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
 

Private Types

typedef latch_meta_t::CounterType Counter
 

Private Attributes

Counter::Count * m_count
 The user visible counters, registered with the meta-data. More...
 
latch_id_t m_id
 Latch meta data ID. More...
 

Additional Inherited Members

- Public Attributes inherited from MutexDebug< Mutex >
uint32_t m_magic_n
 Magic number to check for memory corruption. More...
 
Context m_context
 Latch state of the mutex owner. More...
 

Detailed Description

template<typename Mutex>
class BlockMutexPolicy< Mutex >

Track aggregate metrics policy, used by the page mutex.

There are just too many of them to count individually.

Member Typedef Documentation

◆ Count

template<typename Mutex >
typedef latch_meta_t::CounterType::Count BlockMutexPolicy< Mutex >::Count

◆ Counter

template<typename Mutex >
typedef latch_meta_t::CounterType BlockMutexPolicy< Mutex >::Counter
private

◆ MutexType

template<typename Mutex >
typedef Mutex BlockMutexPolicy< Mutex >::MutexType

Constructor & Destructor Documentation

◆ BlockMutexPolicy()

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

Default constructor.

◆ ~BlockMutexPolicy()

template<typename Mutex >
BlockMutexPolicy< Mutex >::~BlockMutexPolicy ( )
default

Destructor.

Member Function Documentation

◆ add()

template<typename Mutex >
void BlockMutexPolicy< Mutex >::add ( uint32_t  n_spins,
uint32_t  n_waits 
)
inline

Called after a successful mutex acquire.

Parameters
[in]n_spinsNumber of times the thread did spins while trying to acquire the mutex
[in]n_waitsNumber of times the thread waited in some type of OS queue

◆ destroy()

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

Called when the mutex is destroyed.

◆ enter()

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

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_id()

template<typename Mutex >
latch_id_t BlockMutexPolicy< Mutex >::get_id ( ) const
inline
Returns
the latch ID

◆ init()

template<typename Mutex >
void BlockMutexPolicy< Mutex >::init ( const MutexType mutex,
latch_id_t  id,
const char *  filename,
uint32_t  line 
)
inline

Called when the mutex is "created".

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

Parameters
[in]mutexMutex instance to track
[in]idMutex ID
[in]filenameFile where mutex was created
[in]lineLine in filename

◆ locked()

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

Called when the mutex is locked.

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

◆ print()

template<typename Mutex >
std::string BlockMutexPolicy< Mutex >::print ( ) const

Print the information about the latch.

Returns
the string representation

◆ release()

template<typename Mutex >
void BlockMutexPolicy< Mutex >::release ( const MutexType mutex)
inline

Called when the mutex is released.

Parameters
[in]mutexMutex instance that is released

◆ to_string()

template<typename Mutex >
std::string BlockMutexPolicy< Mutex >::to_string
Returns
the string representation

Member Data Documentation

◆ m_count

template<typename Mutex >
Counter::Count* BlockMutexPolicy< Mutex >::m_count
private

The user visible counters, registered with the meta-data.


◆ m_id

template<typename Mutex >
latch_id_t BlockMutexPolicy< Mutex >::m_id
private

Latch meta data ID.


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