MySQL 26.10.0
Source Code Documentation
Runnable Class Reference

Execute in the context of a non detached MySQL thread. More...

#include <os0thread-create.h>

Inheritance diagram for Runnable:
[legend]

Public Member Functions

 Runnable (mysql_pfs_key_t pfs_key, PSI_thread_seqnum pfs_seqnum)
 Constructor for the Runnable object. More...
 
dberr_t setup_thd (const THD *caller_thd=nullptr) noexcept
 Create and configure the current THD for this Runnable. More...
 
 ~Runnable () noexcept
 Destroy the current THD and deregister the MySQL thread. More...
 
template<typename F , typename... Args>
dberr_t operator() (F &&f, Args &&...args)
 Method to execute the callable. More...
 
- Public Member Functions inherited from MySQL_thread
 MySQL_thread (mysql_pfs_key_t pfs_key, PSI_thread_seqnum pfs_seqnum)
 Constructor for the Runnable object. More...
 

Private Member Functions

THD * create_current_thd (const THD *caller_thd) noexcept
 Create and configure the THD used by this DDL worker invocation. More...
 
void destroy_current_thd (THD *thd) noexcept
 Destroy a THD created by create_current_thd(). More...
 

Private Attributes

THD * m_thd {nullptr}
 

Additional Inherited Members

- Protected Member Functions inherited from MySQL_thread
void preamble ()
 Register the thread with the server. More...
 
void epilogue ()
 Deregister the thread. More...
 
THD * create_mysql_thd () noexcept
 
void destroy_mysql_thd (THD *thd) noexcept
 Destroy a THD instance. More...
 
- Protected Attributes inherited from MySQL_thread
const mysql_pfs_key_t m_pfs_key
 Performance schema key. More...
 
PSI_thread_seqnum m_pfs_seqnum
 Performance schema sequence number. More...
 

Detailed Description

Execute in the context of a non detached MySQL thread.

Constructor & Destructor Documentation

◆ Runnable()

Runnable::Runnable ( mysql_pfs_key_t  pfs_key,
PSI_thread_seqnum  pfs_seqnum 
)
inlineexplicit

Constructor for the Runnable object.

Parameters
[in]pfs_keyPerformance schema key
[in]pfs_seqnumPerformance schema sequence number

◆ ~Runnable()

Runnable::~Runnable ( )
inlinenoexcept

Destroy the current THD and deregister the MySQL thread.

Member Function Documentation

◆ create_current_thd()

THD * Runnable::create_current_thd ( const THD *  caller_thd)
inlineprivatenoexcept

Create and configure the THD used by this DDL worker invocation.

◆ destroy_current_thd()

void Runnable::destroy_current_thd ( THD *  thd)
inlineprivatenoexcept

Destroy a THD created by create_current_thd().

◆ operator()()

template<typename F , typename... Args>
dberr_t Runnable::operator() ( F &&  f,
Args &&...  args 
)
inline

Method to execute the callable.

Parameters
[in]fCallable object
[in]argsVariable number of args to F
Return values
freturn value.

◆ setup_thd()

dberr_t Runnable::setup_thd ( const THD *  caller_thd = nullptr)
inlinenoexcept

Create and configure the current THD for this Runnable.

Parameters
[in]caller_thdSource session context to copy, or nullptr.

Member Data Documentation

◆ m_thd

THD* Runnable::m_thd {nullptr}
private

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