MySQL 8.0.39
Source Code Documentation
Sync_point Class Reference

For handling sync points in child threads spawned by a foreground thread. More...

#include <sync0debug.h>

Public Member Functions

 Sync_point (const THD *thd) noexcept
 Constructor. More...
 
 Sync_point (const Sync_point &)=default
 
Sync_pointoperator= (const Sync_point &)=default
 
 ~Sync_point ()=default
 Destructor. More...
 

Static Public Member Functions

static void add (const THD *thd, const std::string &target) noexcept
 Add a target to the list of sync points, nop for duplicates. More...
 
static bool enabled (const THD *thd, const std::string &target) noexcept
 Check if a target is enabled. More...
 
static bool enabled (const std::string &target) noexcept
 Check if a target is enabled. More...
 
static void erase (const THD *thd, const std::string &target) noexcept
 Clear the named target. More...
 

Private Types

using Targets = std::vector< std::string, ut::allocator< std::string > >
 
using Sync_points = std::vector< Sync_point, ut::allocator< Sync_point > >
 

Private Attributes

const THDm_thd {}
 Server connection/session context. More...
 
Targets m_targets {}
 List of enabled targets. More...
 

Static Private Attributes

static std::mutex s_mutex {}
 Mutex protecting access to Sync_point infrastructure. More...
 
static Sync_points s_sync_points {}
 Sync points. More...
 

Detailed Description

For handling sync points in child threads spawned by a foreground thread.

Member Typedef Documentation

◆ Sync_points

◆ Targets

using Sync_point::Targets = std::vector<std::string, ut::allocator<std::string> >
private

Constructor & Destructor Documentation

◆ Sync_point() [1/2]

Sync_point::Sync_point ( const THD thd)
inlineexplicitnoexcept

Constructor.

Parameters
[in,out]thdServer connection/session context.

◆ Sync_point() [2/2]

Sync_point::Sync_point ( const Sync_point )
default

◆ ~Sync_point()

Sync_point::~Sync_point ( )
default

Destructor.

Member Function Documentation

◆ add()

void Sync_point::add ( const THD thd,
const std::string &  target 
)
staticnoexcept

Add a target to the list of sync points, nop for duplicates.

Parameters
[in]thdServer connection/session context.
[in]targetTarget to add.

◆ enabled() [1/2]

bool Sync_point::enabled ( const std::string &  target)
staticnoexcept

Check if a target is enabled.

Disable it if found.

Parameters
[in]targetCheck if target is enabled.
Returns
true if was enabled.

◆ enabled() [2/2]

bool Sync_point::enabled ( const THD thd,
const std::string &  target 
)
staticnoexcept

Check if a target is enabled.

Disable it if found.

Parameters
[in]thdServer connection/session context.
[in]targetCheck if target is enabled.
Returns
true if was enabled.

◆ erase()

void Sync_point::erase ( const THD thd,
const std::string &  target 
)
staticnoexcept

Clear the named target.

Parameters
[in]thdServer connection/session context.
[in]targetCheck if target is enabled.

◆ operator=()

Sync_point & Sync_point::operator= ( const Sync_point )
default

Member Data Documentation

◆ m_targets

Targets Sync_point::m_targets {}
private

List of enabled targets.

◆ m_thd

const THD* Sync_point::m_thd {}
private

Server connection/session context.

◆ s_mutex

std::mutex Sync_point::s_mutex {}
staticprivate

Mutex protecting access to Sync_point infrastructure.

◆ s_sync_points

Sync_point::Sync_points Sync_point::s_sync_points {}
staticprivate

Sync points.


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