MySQL 9.0.0
Source Code Documentation
Mysql_thread Class Reference

A generic single thread executor. More...

#include <mysql_thread.h>

Public Member Functions

 Mysql_thread (PSI_thread_key thread_key, PSI_mutex_key run_mutex_key, PSI_cond_key run_cond_key, PSI_mutex_key dispatcher_mutex_key, PSI_cond_key dispatcher_cond_key)
 Mysql_thread constructor. More...
 
virtual ~Mysql_thread ()
 
bool initialize ()
 Initialize the thread. More...
 
bool terminate ()
 Terminate the thread. More...
 
void dispatcher ()
 Thread worker method. More...
 
bool trigger (Mysql_thread_task *task)
 Trigger a task to run synchronously. More...
 

Private Attributes

PSI_thread_key m_thread_key
 
PSI_mutex_key m_mutex_key
 
PSI_cond_key m_cond_key
 
PSI_mutex_key m_dispatcher_mutex_key
 
PSI_cond_key m_dispatcher_cond_key
 
THDm_thd {nullptr}
 
my_thread_handle m_pthd
 
mysql_mutex_t m_run_lock
 
mysql_cond_t m_run_cond
 
thread_state m_state
 
std::atomic< bool > m_aborted {false}
 
mysql_mutex_t m_dispatcher_lock
 
mysql_cond_t m_dispatcher_cond
 
Abortable_synchronized_queue< Mysql_thread_task * > * m_trigger_queue {nullptr}
 

Detailed Description

A generic single thread executor.

Constructor & Destructor Documentation

◆ Mysql_thread()

Mysql_thread::Mysql_thread ( PSI_thread_key  thread_key,
PSI_mutex_key  run_mutex_key,
PSI_cond_key  run_cond_key,
PSI_mutex_key  dispatcher_mutex_key,
PSI_cond_key  dispatcher_cond_key 
)

Mysql_thread constructor.

◆ ~Mysql_thread()

Mysql_thread::~Mysql_thread ( )
virtual

Member Function Documentation

◆ dispatcher()

void Mysql_thread::dispatcher ( )

Thread worker method.

◆ initialize()

bool Mysql_thread::initialize ( )

Initialize the thread.

Returns
the operation status
Return values
falseSuccessful
trueError

◆ terminate()

bool Mysql_thread::terminate ( )

Terminate the thread.

Returns
the operation status
Return values
falseSuccessful
trueError

◆ trigger()

bool Mysql_thread::trigger ( Mysql_thread_task task)

Trigger a task to run synchronously.

Parameters
[in]tasktask to run
Returns
the operation status
Return values
falseSuccessful
trueError

Member Data Documentation

◆ m_aborted

std::atomic<bool> Mysql_thread::m_aborted {false}
private

◆ m_cond_key

PSI_cond_key Mysql_thread::m_cond_key
private

◆ m_dispatcher_cond

mysql_cond_t Mysql_thread::m_dispatcher_cond
private

◆ m_dispatcher_cond_key

PSI_cond_key Mysql_thread::m_dispatcher_cond_key
private

◆ m_dispatcher_lock

mysql_mutex_t Mysql_thread::m_dispatcher_lock
private

◆ m_dispatcher_mutex_key

PSI_mutex_key Mysql_thread::m_dispatcher_mutex_key
private

◆ m_mutex_key

PSI_mutex_key Mysql_thread::m_mutex_key
private

◆ m_pthd

my_thread_handle Mysql_thread::m_pthd
private

◆ m_run_cond

mysql_cond_t Mysql_thread::m_run_cond
private

◆ m_run_lock

mysql_mutex_t Mysql_thread::m_run_lock
private

◆ m_state

thread_state Mysql_thread::m_state
private

◆ m_thd

THD* Mysql_thread::m_thd {nullptr}
private

◆ m_thread_key

PSI_thread_key Mysql_thread::m_thread_key
private

◆ m_trigger_queue

Abortable_synchronized_queue<Mysql_thread_task *>* Mysql_thread::m_trigger_queue {nullptr}
private

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