MySQL 26.7.0
Source Code Documentation
mysql::concurrency::Mutex_wrapper Class Reference

MySQL wrapper for a mutex, template which may be specialized with a specific implementation of a mutex, e.g. More...

#include <mutex_wrapper.h>

Public Member Functions

 Mutex_wrapper (PSI_mutex_key key)
 
 ~Mutex_wrapper ()
 
 Mutex_wrapper (const Mutex_wrapper &)=delete
 
 Mutex_wrapper (Mutex_wrapper &&)=delete
 
Mutex_wrapperoperator= (const Mutex_wrapper &src)=delete
 
Mutex_wrapperoperator= (Mutex_wrapper &&src)=delete
 
void lock () noexcept
 Acquire a lock, blocks access to a critical section until "unlock" is called. More...
 
bool try_lock () noexcept
 Non-blocking try-lock operation. More...
 
void unlock ()
 Unblocks access to a critical section for other threads. More...
 
decltype(auto) native_handle ()
 Returns the native handle of the mutex. More...
 

Protected Attributes

mysql_mutex_t m_mutex
 

Detailed Description

MySQL wrapper for a mutex, template which may be specialized with a specific implementation of a mutex, e.g.

MySQL mutex, and satisfying the following requirements:

  • Lockable
  • Destructible
  • not copyable
  • not movable

Constructor & Destructor Documentation

◆ Mutex_wrapper() [1/3]

mysql::concurrency::Mutex_wrapper::Mutex_wrapper ( PSI_mutex_key  key)

◆ ~Mutex_wrapper()

mysql::concurrency::Mutex_wrapper::~Mutex_wrapper ( )

◆ Mutex_wrapper() [2/3]

mysql::concurrency::Mutex_wrapper::Mutex_wrapper ( const Mutex_wrapper )
delete

◆ Mutex_wrapper() [3/3]

mysql::concurrency::Mutex_wrapper::Mutex_wrapper ( Mutex_wrapper &&  )
delete

Member Function Documentation

◆ lock()

void mysql::concurrency::Mutex_wrapper::lock ( )
noexcept

Acquire a lock, blocks access to a critical section until "unlock" is called.

◆ native_handle()

decltype(auto) mysql::concurrency::Mutex_wrapper::native_handle ( )
inline

Returns the native handle of the mutex.

Returns
Reference to the underlying mysql_mutex_t object

◆ operator=() [1/2]

Mutex_wrapper & mysql::concurrency::Mutex_wrapper::operator= ( const Mutex_wrapper src)
delete

◆ operator=() [2/2]

Mutex_wrapper & mysql::concurrency::Mutex_wrapper::operator= ( Mutex_wrapper &&  src)
delete

◆ try_lock()

bool mysql::concurrency::Mutex_wrapper::try_lock ( )
noexcept

Non-blocking try-lock operation.

Return values
trueLock has been acquired
falseLock has NOT been acquired

◆ unlock()

void mysql::concurrency::Mutex_wrapper::unlock ( )

Unblocks access to a critical section for other threads.

Member Data Documentation

◆ m_mutex

mysql_mutex_t mysql::concurrency::Mutex_wrapper::m_mutex
protected

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