MySQL 8.4.2
Source Code Documentation
mysql::mutex Class Reference

mutex is a C++ STL mutex (std::mutex) implementation using the instrumented MySQL mutex component API. More...

#include <instrumented_mutex.h>

Public Member Functions

 mutex (PSI_mutex_key key) noexcept
 
 mutex (const mutex &)=delete
 
 ~mutex ()
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 
mysql_mutex_tnative_handle ()
 

Protected Attributes

mysql_mutex_t m_mtx
 
PSI_mutex_key m_key
 

Detailed Description

mutex is a C++ STL mutex (std::mutex) implementation using the instrumented MySQL mutex component API.

This allows for P_S instrumentation of mutexes in components.

Example usage:

namespace x {
...
using mysql::mutex;
...
mutex m(KEY_psi_mutex);
...
std::unique_lock(m);
...
};
mutex is a C++ STL mutex (std::mutex) implementation using the instrumented MySQL mutex component API...
Definition: instrumented_mutex.h:51
mutex(PSI_mutex_key key) noexcept
Definition: instrumented_mutex.h:53

Constructor & Destructor Documentation

◆ mutex() [1/2]

mysql::mutex::mutex ( PSI_mutex_key  key)
inlinenoexcept

◆ mutex() [2/2]

mysql::mutex::mutex ( const mutex )
delete

◆ ~mutex()

mysql::mutex::~mutex ( )
inline

Member Function Documentation

◆ lock()

void mysql::mutex::lock ( )
inline

◆ native_handle()

mysql_mutex_t * mysql::mutex::native_handle ( )
inline

◆ try_lock()

bool mysql::mutex::try_lock ( )
inline

◆ unlock()

void mysql::mutex::unlock ( )
inline

Member Data Documentation

◆ m_key

PSI_mutex_key mysql::mutex::m_key
protected

◆ m_mtx

mysql_mutex_t mysql::mutex::m_mtx
protected

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