MySQL 8.4.2
Source Code Documentation
|
Thread cleanup service allows a OS thread to free resources allocated for specific thread, during thread exit. More...
#include <thread_cleanup_register.h>
Public Attributes | |
mysql_service_status_t(* | register_cleanup )(char const *component_name) |
Enable thread cleanup for calling thread. More... | |
Thread cleanup service allows a OS thread to free resources allocated for specific thread, during thread exit.
Component can register for thread cleanup handler, for desired OS threads.
At thread exit, the service 'thread_cleanup_handler' implemented by the component is invoked by MySQL server.
The service can be instantiated using the registry service with the "thread_cleanup_register" name.
The code below demonstrates way to register thread cleanup for a thread from a component. Note that we cannot deregister thread cleanup event. In case the component is uninstalled, then the thread cleanup is NO-OP.
mysql_service_status_t(* s_mysql_thread_cleanup_register::register_cleanup) (char const *component_name) |
Enable thread cleanup for calling thread.
[in] | component_name | Must be same as the implementation name used for thread_cleanup_handler service. |