18 #ifndef THREAD_POOL_PRIV_INCLUDED
19 #define THREAD_POOL_PRIV_INCLUDED
32 #include <mysqld_error.h>
33 #define MYSQL_SERVER 1
34 #include <scheduler.h>
36 #include <sql_profile.h>
40 typedef std::set<THD*>::iterator Thread_iterator;
42 void* thd_get_scheduler_data(THD *thd);
43 void thd_set_scheduler_data(THD *thd,
void *data);
44 PSI_thread* thd_get_psi(THD *thd);
45 void thd_set_psi(THD *thd, PSI_thread *psi);
48 void thd_set_killed(THD *thd);
49 void thd_clear_errors(THD *thd);
50 void thd_set_thread_stack(THD *thd,
char *stack_start);
51 void thd_lock_thread_count(THD *thd);
52 void thd_unlock_thread_count(THD *thd);
53 void thd_close_connection(THD *thd);
54 THD *thd_get_current_thd();
55 void thd_new_connection_setup(THD *thd,
char *stack_start);
56 void thd_lock_data(THD *thd);
57 void thd_unlock_data(THD *thd);
58 bool thd_is_transaction_active(THD *thd);
59 int thd_connection_has_data(THD *thd);
60 void thd_set_net_read_write(THD *thd, uint val);
61 uint thd_get_net_read_write(THD *thd);
63 ulong thd_get_net_wait_timeout(THD *thd);
64 my_socket thd_get_fd(THD *thd);
65 int thd_store_globals(THD* thd);
68 Thread_iterator thd_get_global_thread_list_begin();
69 Thread_iterator thd_get_global_thread_list_end();
72 void sql_print_error(
const char *format, ...);
75 bool schema_table_store_record(THD *thd,
TABLE *
table);
93 bool init_new_connection_handler_thread();
95 bool setup_connection_thread_globals(THD *thd);
97 bool thd_prepare_connection(THD *thd);
99 void mysql_audit_release(THD *thd);
101 bool thd_is_connection_alive(THD *thd);
103 void close_connection(THD *thd, uint errcode);
105 void end_connection(THD *thd);
107 void thd_release_resources(THD *thd);
109 void dec_connection_count();
111 void destroy_thd(THD *thd);
113 void remove_global_thread(THD *thd);
129 void inc_thread_created(
void);
130 ulong get_max_connections(
void);
131 pthread_attr_t *get_connection_attrib(
void);