MySQL  8.0.19
Source Code Documentation
Runnable Class Reference

Wrapper for a callable, it will count the number of registered Runnable instances and will register the thread executing the callable with the PFS and the Server threading infrastructure. More...

#include <os0thread-create.h>

Public Member Functions

 Runnable (mysql_pfs_key_t pfs_key)
 Constructor for the Runnable object. More...
 
template<typename F , typename... Args>
void operator() (F &&f, Args &&... args)
 Method to execute the callable. More...
 
IB_thread thread () const
 

Private Member Functions

void preamble ()
 Register the thread with the server. More...
 
void epilogue ()
 Deregister the thread. More...
 
void init ()
 Initializes the m_shared_future, uses the m_promise's get_future, which cannot be used since then, according to its documentation. More...
 

Private Attributes

const mysql_pfs_key_t m_pfs_key
 Performance schema key. More...
 
std::promise< void > m_promise
 Promise which is set when task is done. More...
 
IB_thread m_thread
 Future object which keeps the ref counter >= 1 at least as long as the Runnable is non-destroyed. More...
 

Detailed Description

Wrapper for a callable, it will count the number of registered Runnable instances and will register the thread executing the callable with the PFS and the Server threading infrastructure.

Constructor & Destructor Documentation

◆ Runnable()

Runnable::Runnable ( mysql_pfs_key_t  pfs_key)
inlineexplicit

Constructor for the Runnable object.

Parameters
[in]pfs_keyPerformance schema key

Member Function Documentation

◆ epilogue()

void Runnable::epilogue ( )
inlineprivate

Deregister the thread.

◆ init()

void Runnable::init ( )
inlineprivate

Initializes the m_shared_future, uses the m_promise's get_future, which cannot be used since then, according to its documentation.

◆ operator()()

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

Method to execute the callable.

Parameters
[in]fCallable object
[in]argsVariable number of args to F

◆ preamble()

void Runnable::preamble ( )
inlineprivate

Register the thread with the server.

◆ thread()

IB_thread Runnable::thread ( ) const
inline

Member Data Documentation

◆ m_pfs_key

const mysql_pfs_key_t Runnable::m_pfs_key
private

Performance schema key.

◆ m_promise

std::promise<void> Runnable::m_promise
private

Promise which is set when task is done.

◆ m_thread

IB_thread Runnable::m_thread
mutableprivate

Future object which keeps the ref counter >= 1 at least as long as the Runnable is non-destroyed.


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