MySQL 8.3.0
Source Code Documentation
Rpl_applier_reader::Stage_controller Class Reference

It manages a stage and the related mutex and makes the process of locking and entering stage/unlock and exiting stage as monolithic operations. More...

Public Types

enum  State { INACTIVE , LOCKED , IN_STAGE }
 

Public Member Functions

 Stage_controller (THD *thd, mysql_mutex_t *mutex, mysql_cond_t *cond, const PSI_stage_info &new_stage, enum State state=INACTIVE)
 
 ~Stage_controller ()
 
void lock ()
 
void enter_stage ()
 

Private Attributes

THDm_thd = nullptr
 
mysql_mutex_tm_mutex = nullptr
 
mysql_cond_tm_cond = nullptr
 
PSI_stage_info m_old_stage
 
const PSI_stage_infom_new_stage
 
enum State m_state = INACTIVE
 

Detailed Description

It manages a stage and the related mutex and makes the process of locking and entering stage/unlock and exiting stage as monolithic operations.

  • locking and entering stage can be done in the constructor automatically.
  • unlocking and exiting stage are done in the destructor automatically. So the caller just need to initialize an Stage_controller object in a proper code block. It will exit the stage automatically when the object is destroyed.

Member Enumeration Documentation

◆ State

Enumerator
INACTIVE 
LOCKED 
IN_STAGE 

Constructor & Destructor Documentation

◆ Stage_controller()

Rpl_applier_reader::Stage_controller::Stage_controller ( THD thd,
mysql_mutex_t mutex,
mysql_cond_t cond,
const PSI_stage_info new_stage,
enum State  state = INACTIVE 
)
inline

◆ ~Stage_controller()

Rpl_applier_reader::Stage_controller::~Stage_controller ( )
inline

Member Function Documentation

◆ enter_stage()

void Rpl_applier_reader::Stage_controller::enter_stage ( )
inline

◆ lock()

void Rpl_applier_reader::Stage_controller::lock ( )
inline

Member Data Documentation

◆ m_cond

mysql_cond_t* Rpl_applier_reader::Stage_controller::m_cond = nullptr
private

◆ m_mutex

mysql_mutex_t* Rpl_applier_reader::Stage_controller::m_mutex = nullptr
private

◆ m_new_stage

const PSI_stage_info& Rpl_applier_reader::Stage_controller::m_new_stage
private

◆ m_old_stage

PSI_stage_info Rpl_applier_reader::Stage_controller::m_old_stage
private

◆ m_state

enum State Rpl_applier_reader::Stage_controller::m_state = INACTIVE
private

◆ m_thd

THD* Rpl_applier_reader::Stage_controller::m_thd = nullptr
private

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