MySQL 8.0.40
Source Code Documentation
My_xp_mutex Class Referenceabstract

Abstract class used to wrap mutex for various implementations. More...

#include <my_xp_mutex.h>

Inheritance diagram for My_xp_mutex:
[legend]

Public Member Functions

virtual int init (PSI_mutex_key key, const native_mutexattr_t *attr)=0
 Initialize mutex. More...
 
virtual int destroy ()=0
 Destroy mutex. More...
 
virtual int lock ()=0
 Lock mutex. More...
 
virtual int trylock ()=0
 Trylock mutex. More...
 
virtual int unlock ()=0
 Unlock mutex. More...
 
virtual mysql_mutex_tget_native_mutex ()=0
 To get native mutex reference. More...
 
virtual ~My_xp_mutex ()=default
 

Detailed Description

Abstract class used to wrap mutex for various implementations.

A typical use case is:

mutex->init(mutex_PSI_key, NULL);
mutex->lock();
...
mutex->unlock();
Definition: my_xp_mutex.h:123
Abstract class used to wrap mutex for various implementations.
Definition: my_xp_mutex.h:47
virtual int init(PSI_mutex_key key, const native_mutexattr_t *attr)=0
Initialize mutex.
virtual int lock()=0
Lock mutex.
#define NULL
Definition: types.h:55

Constructor & Destructor Documentation

◆ ~My_xp_mutex()

virtual My_xp_mutex::~My_xp_mutex ( )
virtualdefault

Member Function Documentation

◆ destroy()

virtual int My_xp_mutex::destroy ( )
pure virtual

Destroy mutex.

Returns
success status

Implemented in My_xp_mutex_server.

◆ get_native_mutex()

virtual mysql_mutex_t * My_xp_mutex::get_native_mutex ( )
pure virtual

To get native mutex reference.

Returns
native mutex pointer

Implemented in My_xp_mutex_server.

◆ init()

virtual int My_xp_mutex::init ( PSI_mutex_key  key,
const native_mutexattr_t attr 
)
pure virtual

Initialize mutex.

Parameters
keymutex instrumentation key
attrmutex attributes reference
Returns
success status

Implemented in My_xp_mutex_server.

◆ lock()

virtual int My_xp_mutex::lock ( )
pure virtual

Lock mutex.

Returns
success status

Implemented in My_xp_mutex_server.

◆ trylock()

virtual int My_xp_mutex::trylock ( )
pure virtual

Trylock mutex.

Returns
success status

Implemented in My_xp_mutex_server.

◆ unlock()

virtual int My_xp_mutex::unlock ( )
pure virtual

Unlock mutex.

Returns
success status

Implemented in My_xp_mutex_server.


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