Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual Excerpts from this Manual mysql_thread_end()

void mysql_thread_end(void)


Call this function before calling pthread_exit() to free memory allocated by mysql_thread_init().

mysql_thread_end() is not invoked automatically by the client library. Before MySQL 5.7.9, it must be called for each mysql_thread_init() call to avoid a memory leak. As of MySQL 5.7.9, C API internals were reimplemented to reduce the amount of information allocated by mysql_thread_init() that must be freed by mysql_thread_end():

Return Values


Download this Manual
User Comments
  Posted by Armin Schöffmann on March 6, 2005
According to dll.c:
Within win32, LibMain calls mysql_thread_init() and mysql_thread_end() automatically for each newly created thread after the lib has been loaded.
Therefor it shouldn't be necessary to call these functions again. As I said, only for win32 and only if we use the dynamic library.
Sign Up Login You must be logged in to post a comment.