MySQL 8.4.2
Source Code Documentation
binlog::AtomicBgcTicketGuard Class Reference

RAII opaque for AtomicBgcTicket (set in use/set used synchronization operations in constructor/destructor) More...

#include <atomic_bgc_ticket_guard.h>

Public Member Functions

virtual ~AtomicBgcTicketGuard ()
 
 AtomicBgcTicketGuard (AtomicBgcTicketGuard const &)=delete
 
AtomicBgcTicketGuardoperator= (AtomicBgcTicketGuard const &)=delete
 
BgcTicket get_next () const
 "Next" value accessor. More...
 
BgcTicket get_prev () const
 "Previous" value accessor. More...
 
void set_next (const BgcTicket &next)
 Function used to manually manipulate the "next" ticket value. More...
 

Protected Member Functions

 AtomicBgcTicketGuard (AtomicBgcTicket &bgcTicket, const BgcTicket &next_value)
 Constructor. More...
 
 AtomicBgcTicketGuard (AtomicBgcTicket &bgcTicket, bool inc_next_before_release=false)
 Constructor. More...
 

Protected Attributes

std::reference_wrapper< AtomicBgcTicketm_ref
 For threads to synchronize properly, AtomicBgcTicketGuard instances must operate on the same instance of AtomicBgcTicket. More...
 
BgcTicket m_next_value
 value to be set during the "release" op More...
 
BgcTicket m_prev_value
 previous ticket value, obtained during the "acquire" op More...
 

Friends

class AtomicBgcTicket
 

Detailed Description

RAII opaque for AtomicBgcTicket (set in use/set used synchronization operations in constructor/destructor)

Constructor & Destructor Documentation

◆ ~AtomicBgcTicketGuard()

binlog::AtomicBgcTicketGuard::~AtomicBgcTicketGuard ( )
virtual

◆ AtomicBgcTicketGuard() [1/3]

binlog::AtomicBgcTicketGuard::AtomicBgcTicketGuard ( AtomicBgcTicketGuard const &  )
delete

◆ AtomicBgcTicketGuard() [2/3]

binlog::AtomicBgcTicketGuard::AtomicBgcTicketGuard ( AtomicBgcTicket bgcTicket,
const BgcTicket next_value 
)
protected

Constructor.

Parameters
[in]bgcTicketReference to atomic ticket instance
[in]next_valueBefore "release" operation, ticket value is set to the next_value.

◆ AtomicBgcTicketGuard() [3/3]

binlog::AtomicBgcTicketGuard::AtomicBgcTicketGuard ( AtomicBgcTicket bgcTicket,
bool  inc_next_before_release = false 
)
protected

Constructor.

Parameters
[in]bgcTicketReference to atomic ticket instance
[in]inc_next_before_releaseBefore "release" operation, ticket value is set to the value+1 in case inc_next_before_release is equal to true

Member Function Documentation

◆ get_next()

BgcTicket binlog::AtomicBgcTicketGuard::get_next ( ) const

"Next" value accessor.

Before "release" operation, ticket value is set to the returned "next" ticket.

Returns
BgcTicket with next ticket value

◆ get_prev()

BgcTicket binlog::AtomicBgcTicketGuard::get_prev ( ) const

"Previous" value accessor.

During the "acquire" operation, ticket value is set to the returned "previous" ticket.

Returns
BgcTicket with previous ticket value

◆ operator=()

AtomicBgcTicketGuard & binlog::AtomicBgcTicketGuard::operator= ( AtomicBgcTicketGuard const &  )
delete

◆ set_next()

void binlog::AtomicBgcTicketGuard::set_next ( const BgcTicket next)

Function used to manually manipulate the "next" ticket value.

The 'set_next' function will determine the value of the ticket after the "release" operation. It can be the same value, but it might be the value incremented by one, depending on the current usage.

Parameters
nextNext value for the AtomicBgcTicket referenced by this instance of the AtomicBgcTicketGuard

Friends And Related Function Documentation

◆ AtomicBgcTicket

friend class AtomicBgcTicket
friend

Member Data Documentation

◆ m_next_value

BgcTicket binlog::AtomicBgcTicketGuard::m_next_value
protected

value to be set during the "release" op

◆ m_prev_value

BgcTicket binlog::AtomicBgcTicketGuard::m_prev_value
protected

previous ticket value, obtained during the "acquire" op

◆ m_ref

std::reference_wrapper<AtomicBgcTicket> binlog::AtomicBgcTicketGuard::m_ref
protected

For threads to synchronize properly, AtomicBgcTicketGuard instances must operate on the same instance of AtomicBgcTicket.

This is a reference to atomic Bgc ticket instance, used by different instances of the BgcTicketGuard class (e.g. front/back ticket in BgcTicketManager class)


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