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()