MySQL 8.4.0
Source Code Documentation
temptable::Lock_free_type< T, ALIGN, TypeSelector > Struct Template Reference

Representation of an atomic type which is guaranteed to be always-lock-free. More...

#include <lock_free_type.h>

Public Types

using Type = typename TypeSelector< T >::Type
 

Public Attributes

std::atomic< Typem_value
 

Detailed Description

template<typename T, Alignment ALIGN = Alignment::NATURAL, template< typename, typename=void > class TypeSelector = Lock_free_type_selector>
struct temptable::Lock_free_type< T, ALIGN, TypeSelector >

Representation of an atomic type which is guaranteed to be always-lock-free.

In case always-lock-free property cannot be satisfied for given T, Lock_free_type instantiation will fail with the compile-time error.

Always-lock-free guarantee is implemented through the means of Lock_free_type_selector or Largest_lock_free_type_selector. User code can opt-in for any of those. By default, Lock_free_type_selector is used.

In addition, this type provides an ability to redefine the alignment-requirement of the underlying always-lock-free type, basically making it possible to over-align T to the size of the L1-data cache-line size. By default, T has a natural alignment.

Member Typedef Documentation

◆ Type

template<typename T , Alignment ALIGN = Alignment::NATURAL, template< typename, typename=void > class TypeSelector = Lock_free_type_selector>
using temptable::Lock_free_type< T, ALIGN, TypeSelector >::Type = typename TypeSelector<T>::Type

Member Data Documentation

◆ m_value

template<typename T , Alignment ALIGN = Alignment::NATURAL, template< typename, typename=void > class TypeSelector = Lock_free_type_selector>
std::atomic<Type> temptable::Lock_free_type< T, ALIGN, TypeSelector >::m_value

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