MySQL 9.1.0
Source Code Documentation
GenericPolicy< Mutex > Struct Template Reference

Collect the metrics per mutex instance, no aggregation. More...

#include <sync0policy.h>

Inheritance diagram for GenericPolicy< Mutex >:
[legend]

Public Types

typedef Mutex MutexType
 

Public Member Functions

 GenericPolicy () 1
 Constructor. More...
 
 ~GenericPolicy ()=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 enter (const MutexType &mutex, const char *filename, ulint line) 1
 Called when an attempt is made to lock the mutex. 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...
 
std::string print () const 1
 Print the information about the latch. More...
 
latch_id_t get_id () const 1
 
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>
struct GenericPolicy< Mutex >

Collect the metrics per mutex instance, no aggregation.

Member Typedef Documentation

◆ Counter

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

◆ MutexType

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

Constructor & Destructor Documentation

◆ GenericPolicy()

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

Constructor.

◆ ~GenericPolicy()

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

Destructor.

Member Function Documentation

◆ add()

template<typename Mutex >
void GenericPolicy< 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 GenericPolicy< Mutex >::destroy ( )
inline

Called when the mutex is destroyed.

◆ enter()

template<typename Mutex >
void GenericPolicy< 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 GenericPolicy< Mutex >::get_id ( ) const
inline
Returns
the latch ID

◆ init()

template<typename Mutex >
void GenericPolicy< 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 GenericPolicy< 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 GenericPolicy< Mutex >::print ( ) const

Print the information about the latch.

Returns
the string representation

◆ release()

template<typename Mutex >
void GenericPolicy< 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 GenericPolicy< Mutex >::to_string
Returns
the string representation

Member Data Documentation

◆ m_count

template<typename Mutex >
Counter::Count GenericPolicy< Mutex >::m_count
private

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


◆ m_id

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

Latch meta data ID.


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