MySQL 26.10.0
Source Code Documentation
hm::Thread Class Referenceabstract

#include <health_monitor_thread.h>

Inheritance diagram for hm::Thread:
[legend]

Public Member Functions

 Thread ()=default
 
 Thread (const char *name, const char *instr_name, const char *os_name, const char *desc)
 
virtual ~Thread ()=0
 
const char * name () const
 
virtual bool running () const
 
virtual int start ()
 
virtual void stop ()
 
virtual void run_process ()
 Main thread loop. More...
 
void signal ()
 Signal the processing loop to end the current cycle. More...
 

Static Public Member Functions

static void cleanup ()
 Cleanup thread instrumentation. More...
 
static int join (my_thread_handle *thread, void **value_ptr)
 
static bool joinable (const my_thread_handle &thread)
 

Protected Member Functions

int start_thread ()
 
void stop_thread ()
 
void request_thread_stop ()
 Request that the worker stop without waiting for it to exit. More...
 
void join_thread ()
 Wait for a stopped worker to exit. More...
 
bool stop_requested ()
 Return true when worker shutdown has been requested. More...
 
virtual void pre_process ()
 
virtual void process ()
 
virtual void post_process ()
 

Protected Attributes

std::mutex m_command_lock
 
const std::string m_name
 
const std::string m_instr_name
 
const std::string m_os_name
 
const std::string m_description
 
std::atomic< bool > m_thread_running {false}
 
bool m_stop {false}
 
my_thread_handle m_thread
 
PSI_thread_key m_thread_key {0}
 
PSI_thread_info m_thread_info
 
mysql_mutex_t m_wait_lock
 
PSI_mutex_key m_mutex_key {0}
 
PSI_mutex_info m_mutex_info
 
mysql_cond_t m_wait
 
PSI_cond_key m_cond_key {0}
 
PSI_cond_info m_cond_info
 

Constructor & Destructor Documentation

◆ Thread() [1/2]

hm::Thread::Thread ( )
default

◆ Thread() [2/2]

hm::Thread::Thread ( const char *  name,
const char *  instr_name,
const char *  os_name,
const char *  desc 
)

◆ ~Thread()

hm::Thread::~Thread ( )
pure virtual

Member Function Documentation

◆ cleanup()

void hm::Thread::cleanup ( )
static

Cleanup thread instrumentation.

◆ join()

int hm::Thread::join ( my_thread_handle *  thread,
void **  value_ptr 
)
static

◆ join_thread()

void hm::Thread::join_thread ( )
protected

Wait for a stopped worker to exit.

◆ joinable()

bool hm::Thread::joinable ( const my_thread_handle &  thread)
static

◆ name()

const char * hm::Thread::name ( ) const
inline

◆ post_process()

virtual void hm::Thread::post_process ( )
inlineprotectedvirtual

◆ pre_process()

virtual void hm::Thread::pre_process ( )
inlineprotectedvirtual

◆ process()

virtual void hm::Thread::process ( )
inlineprotectedvirtual

◆ request_thread_stop()

void hm::Thread::request_thread_stop ( )
protected

Request that the worker stop without waiting for it to exit.

◆ run_process()

void hm::Thread::run_process ( )
virtual

Main thread loop.

Reimplemented in hm::Collector, hm::Supervisor, and hm::Triggered_Reporter.

◆ running()

virtual bool hm::Thread::running ( ) const
inlinevirtual

◆ signal()

void hm::Thread::signal ( )

Signal the processing loop to end the current cycle.

◆ start()

int hm::Thread::start ( )
virtual

◆ start_thread()

int hm::Thread::start_thread ( )
protected

◆ stop()

void hm::Thread::stop ( )
virtual

◆ stop_requested()

bool hm::Thread::stop_requested ( )
protected

Return true when worker shutdown has been requested.

◆ stop_thread()

void hm::Thread::stop_thread ( )
protected

Member Data Documentation

◆ m_command_lock

std::mutex hm::Thread::m_command_lock
protected

◆ m_cond_info

PSI_cond_info hm::Thread::m_cond_info
protected
Initial value:
const std::string m_instr_name
Definition: health_monitor_thread.h:77
PSI_cond_key m_cond_key
Definition: health_monitor_thread.h:99
#define PSI_DOCUMENT_ME
Definition: component_common.h:29
#define PSI_FLAG_SINGLETON
Singleton flag.
Definition: component_common.h:35
#define PSI_VOLATILITY_PROVISIONING
Definition: psi_bits.h:155

◆ m_cond_key

PSI_cond_key hm::Thread::m_cond_key {0}
protected

◆ m_description

const std::string hm::Thread::m_description
protected

◆ m_instr_name

const std::string hm::Thread::m_instr_name
protected

◆ m_mutex_info

PSI_mutex_info hm::Thread::m_mutex_info
protected
Initial value:
PSI_mutex_key m_mutex_key
Definition: health_monitor_thread.h:94

◆ m_mutex_key

PSI_mutex_key hm::Thread::m_mutex_key {0}
protected

◆ m_name

const std::string hm::Thread::m_name
protected

◆ m_os_name

const std::string hm::Thread::m_os_name
protected

◆ m_stop

bool hm::Thread::m_stop {false}
protected

◆ m_thread

my_thread_handle hm::Thread::m_thread
protected

◆ m_thread_info

PSI_thread_info hm::Thread::m_thread_info
protected
Initial value:
{
m_instr_name.c_str(),
m_os_name.c_str(),
m_description.c_str()}
PSI_thread_key m_thread_key
Definition: health_monitor_thread.h:84
const std::string m_description
Definition: health_monitor_thread.h:79
const std::string m_os_name
Definition: health_monitor_thread.h:78
#define PSI_FLAG_THREAD_SYSTEM
System thread flag.
Definition: psi_bits.h:124

◆ m_thread_key

PSI_thread_key hm::Thread::m_thread_key {0}
protected

◆ m_thread_running

std::atomic<bool> hm::Thread::m_thread_running {false}
protected

◆ m_wait

mysql_cond_t hm::Thread::m_wait
protected

◆ m_wait_lock

mysql_mutex_t hm::Thread::m_wait_lock
protected

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