MySQL 8.0.39
Source Code Documentation
mysqlrouter::MySQLClientThreadToken Class Referencefinal

Thread Token for libmysqlclient API users. More...

#include <mysql_client_thread_token.h>

Public Member Functions

 MySQLClientThreadToken ()
 
 ~MySQLClientThreadToken ()
 

Private Member Functions

 MySQLClientThreadToken (const MySQLClientThreadToken &)=delete
 
MySQLClientThreadTokenoperator= (const MySQLClientThreadToken &)=delete
 
 MySQLClientThreadToken (MySQLClientThreadToken &&)=delete
 
MySQLClientThreadTokenoperator= (MySQLClientThreadToken &&)=delete
 

Detailed Description

Thread Token for libmysqlclient API users.

libmysqlclient requires that all threads that used the API deinit via mysql_thread_end()

Note
Not calling mysql_thread_end() for a thread which had mysql_thread_init() called leads to 5 seconds wait on mysql_library_end() in debug-builds.

While the first call to to mysql_init() in a thread calls, mysql_thread_init() automatically, there is no equivalent for the shutdown.

Placing the thread token on the stack ensures right after the thread is started ensures, the thread is properly accounted for by libmysqlclient.

void *some_thread(void *) {
if (true) throw std::runtime_error();
return nullptr;
}
MySQLClientThreadToken()
Definition: mysql_client_thread_token.h:68
See also
mysql_library_end()
mysql_thread_end()
my_thread_end()

Constructor & Destructor Documentation

◆ MySQLClientThreadToken() [1/3]

mysqlrouter::MySQLClientThreadToken::MySQLClientThreadToken ( )
inline

◆ ~MySQLClientThreadToken()

mysqlrouter::MySQLClientThreadToken::~MySQLClientThreadToken ( )
inline

◆ MySQLClientThreadToken() [2/3]

mysqlrouter::MySQLClientThreadToken::MySQLClientThreadToken ( const MySQLClientThreadToken )
privatedelete

◆ MySQLClientThreadToken() [3/3]

mysqlrouter::MySQLClientThreadToken::MySQLClientThreadToken ( MySQLClientThreadToken &&  )
privatedelete

Member Function Documentation

◆ operator=() [1/2]

MySQLClientThreadToken & mysqlrouter::MySQLClientThreadToken::operator= ( const MySQLClientThreadToken )
privatedelete

◆ operator=() [2/2]

MySQLClientThreadToken & mysqlrouter::MySQLClientThreadToken::operator= ( MySQLClientThreadToken &&  )
privatedelete

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