MySQL 9.6.0
Source Code Documentation
s_mysql_mysql_my_thread Struct Reference

A service allowing allocation thread specific memory for a calling thread. More...

#include <mysql_my_thread.h>

Public Attributes

mysql_service_status_t(* attach )()
 
mysql_service_status_t(* detach )()
 
mysql_service_status_t(* is_attached )()
 

Detailed Description

A service allowing allocation thread specific memory for a calling thread.

Specific memory is used by mysys and dbug purposes. The example below shows how to use the service by the std::thread that uses the mysql_service_mysql_debug_keyword_service service. keyword);

static void *a_thread(void *arg) {
// Allocate thread memory
mysql_service_mysql_my_thread->attach();
// Thread custom code begins here
if
(mysql_service_mysql_debug_keyword_service->lookup_debug_keyword("my_keyword"))
printf("my_keyword found!");
// Deallocate thread memory on thread exit.
mysql_service_mysql_my_thread->detach();
return nullptr;
}
std::thread thread(a_thread);
thread.join();

Member Data Documentation

◆ attach

mysql_service_status_t(* s_mysql_mysql_my_thread::attach) ()

◆ detach

mysql_service_status_t(* s_mysql_mysql_my_thread::detach) ()

◆ is_attached

mysql_service_status_t(* s_mysql_mysql_my_thread::is_attached) ()

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