MySQL 9.0.0
Source Code Documentation
OSMutex Struct Reference

OS mutex, without any policy. More...

#include <sync0types.h>

Public Member Functions

 OSMutex () 1
 Constructor. More...
 
void init () 1
 Create the mutex by calling the system functions. More...
 
 ~OSMutex ()=default
 Destructor. More...
 
void destroy () 1
 Destroy the mutex. More...
 
void exit () 1
 Release the mutex. More...
 
void enter () 1
 Acquire the mutex. More...
 
void lock ()
 
void unlock ()
 
bool try_lock () 1
 
 operator sys_mutex_t * () 1
 Required for os_event_t. More...
 

Private Attributes

bool m_freed
 true if the mutex has been freed/destroyed. More...
 
sys_mutex_t m_mutex
 

Detailed Description

OS mutex, without any policy.

It is a thin wrapper around the system mutexes. The interface is different from the policy mutexes, to ensure that it is called directly and not confused with the policy mutexes.

Constructor & Destructor Documentation

◆ OSMutex()

OSMutex::OSMutex ( )
inline

Constructor.

◆ ~OSMutex()

OSMutex::~OSMutex ( )
default

Destructor.

Member Function Documentation

◆ destroy()

void OSMutex::destroy ( )
inline

Destroy the mutex.

◆ enter()

void OSMutex::enter ( )
inline

Acquire the mutex.

◆ exit()

void OSMutex::exit ( )
inline

Release the mutex.

◆ init()

void OSMutex::init ( void  )
inline

Create the mutex by calling the system functions.

◆ lock()

void OSMutex::lock ( )
inline

◆ operator sys_mutex_t *()

OSMutex::operator sys_mutex_t * ( )
inline

Required for os_event_t.

◆ try_lock()

bool OSMutex::try_lock ( )
inline
Returns
true if locking succeeded

◆ unlock()

void OSMutex::unlock ( )
inline

Member Data Documentation

◆ m_freed

bool OSMutex::m_freed
private

true if the mutex has been freed/destroyed.

◆ m_mutex

sys_mutex_t OSMutex::m_mutex
private

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