MySQL 8.0.40
Source Code Documentation
OSTrackMutex< Policy > Struct Template Reference

OS mutex for tracking lock/unlock for debugging. More...

#include <ib0mutex.h>

Public Types

typedef Policy< OSTrackMutexMutexPolicy
 

Public Member Functions

 OSTrackMutex (bool destroy_mutex_at_exit=true) 1
 
 ~OSTrackMutex () 1
 
void init (latch_id_t id, const char *filename, uint32_t line) 1
 Initialise the mutex. More...
 
void destroy () 1
 Destroy the mutex. More...
 
void exit () 1
 Release the mutex. More...
 
void enter (uint32_t max_spins, uint32_t max_delay, const char *filename, uint32_t line) 1
 Acquire the mutex. More...
 
void lock ()
 
void unlock ()
 
bool try_lock () 1
 
bool is_owned () const 1
 
MutexPolicypolicy () 1
 
const MutexPolicypolicy () const 1
 

Private Attributes

bool m_freed
 true if the mutex has not be initialized More...
 
bool m_locked
 true if the mutex has been locked. More...
 
bool m_destroy_at_exit
 Do/Dont destroy mutex at exit. More...
 
OSMutex m_mutex
 OS Mutex instance. More...
 
MutexPolicy m_policy
 Policy data. More...
 

Detailed Description

template<template< typename > class Policy = NoPolicy>
struct OSTrackMutex< Policy >

OS mutex for tracking lock/unlock for debugging.

Member Typedef Documentation

◆ MutexPolicy

template<template< typename > class Policy = NoPolicy>
typedef Policy<OSTrackMutex> OSTrackMutex< Policy >::MutexPolicy

Constructor & Destructor Documentation

◆ OSTrackMutex()

template<template< typename > class Policy = NoPolicy>
OSTrackMutex< Policy >::OSTrackMutex ( bool  destroy_mutex_at_exit = true)
inlineexplicit

◆ ~OSTrackMutex()

template<template< typename > class Policy = NoPolicy>
OSTrackMutex< Policy >::~OSTrackMutex ( )
inline

Member Function Documentation

◆ destroy()

template<template< typename > class Policy = NoPolicy>
void OSTrackMutex< Policy >::destroy ( )
inline

Destroy the mutex.

◆ enter()

template<template< typename > class Policy = NoPolicy>
void OSTrackMutex< Policy >::enter ( uint32_t  max_spins,
uint32_t  max_delay,
const char *  filename,
uint32_t  line 
)
inline

Acquire the mutex.

Parameters
[in]max_spinsmax number of spins
[in]max_delaymax delay per spin
[in]filenamefrom where called
[in]linewithin filename

◆ exit()

template<template< typename > class Policy = NoPolicy>
void OSTrackMutex< Policy >::exit ( )
inline

Release the mutex.

◆ init()

template<template< typename > class Policy = NoPolicy>
void OSTrackMutex< Policy >::init ( latch_id_t  id,
const char *  filename,
uint32_t  line 
)
inline

Initialise the mutex.

Parameters
[in]idMutex ID
[in]filenameFile where mutex was created
[in]lineLine in filename

◆ is_owned()

template<template< typename > class Policy = NoPolicy>
bool OSTrackMutex< Policy >::is_owned ( ) const
inline
Returns
true if the thread owns the mutex.

◆ lock()

template<template< typename > class Policy = NoPolicy>
void OSTrackMutex< Policy >::lock ( )
inline

◆ policy() [1/2]

template<template< typename > class Policy = NoPolicy>
MutexPolicy & OSTrackMutex< Policy >::policy ( )
inline
Returns
non-const version of the policy

◆ policy() [2/2]

template<template< typename > class Policy = NoPolicy>
const MutexPolicy & OSTrackMutex< Policy >::policy ( ) const
inline
Returns
the const version of the policy

◆ try_lock()

template<template< typename > class Policy = NoPolicy>
bool OSTrackMutex< Policy >::try_lock ( )
inline
Returns
true if locking succeeded

◆ unlock()

template<template< typename > class Policy = NoPolicy>
void OSTrackMutex< Policy >::unlock ( )
inline

Member Data Documentation

◆ m_destroy_at_exit

template<template< typename > class Policy = NoPolicy>
bool OSTrackMutex< Policy >::m_destroy_at_exit
private

Do/Dont destroy mutex at exit.

◆ m_freed

template<template< typename > class Policy = NoPolicy>
bool OSTrackMutex< Policy >::m_freed
private

true if the mutex has not be initialized

◆ m_locked

template<template< typename > class Policy = NoPolicy>
bool OSTrackMutex< Policy >::m_locked
private

true if the mutex has been locked.

◆ m_mutex

template<template< typename > class Policy = NoPolicy>
OSMutex OSTrackMutex< Policy >::m_mutex
private

OS Mutex instance.

◆ m_policy

template<template< typename > class Policy = NoPolicy>
MutexPolicy OSTrackMutex< Policy >::m_policy
private

Policy data.


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