MySQL 26.7.0
Source Code Documentation
Atomic_sysvar< T >::Data Struct Reference

Contains all members of Atomic_sysvar<T> in a standard layout struct - which, among other things, means we can't mix private with public, use virtual methods, nor std::function<>. More...

Public Attributes

T m_nonatomic
 InnoDB code should not look at this, nor modify this directly (except in the update() function defined here). More...
 
std::atomic< Tm_atomic
 This stores the atomic variable which InnoDB threads might access at any moment via load(). More...
 
void(* m_after_change )()
 This is a callback provided by InnoDB to be called after each change of the value which happens after innodb_init_params(), i.e. More...
 

Detailed Description

template<typename T>
struct Atomic_sysvar< T >::Data

Contains all members of Atomic_sysvar<T> in a standard layout struct - which, among other things, means we can't mix private with public, use virtual methods, nor std::function<>.

We need a struct with standard layout in which the non-atomic variable is at offset 0, to make it possible to convert a pointer to the non-atomic variable registered via plugin API, to a pointer to the whole struct containing the atomic we need to update and callback we need to call on each change of registered variable.

Member Data Documentation

◆ m_after_change

template<typename T >
void(* Atomic_sysvar< T >::Data::m_after_change) ()

This is a callback provided by InnoDB to be called after each change of the value which happens after innodb_init_params(), i.e.

when performing SET. Note: this includes recovered values of SET PERSIST.

◆ m_atomic

template<typename T >
std::atomic<T> Atomic_sysvar< T >::Data::m_atomic

This stores the atomic variable which InnoDB threads might access at any moment via load().

It has a copy of m_nonatomic value, detected either during innodb_init_params() or in update() handler.

◆ m_nonatomic

template<typename T >
T Atomic_sysvar< T >::Data::m_nonatomic

InnoDB code should not look at this, nor modify this directly (except in the update() function defined here).

This will be registered via plugin API and managed by Server layer. It must be the first member. Note: Server modifies this directly without calling update() at startup.


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