26#ifndef THREAD_POOL_PRIV_INCLUDED
27#define THREAD_POOL_PRIV_INCLUDED
33#include <mysqld_error.h>
147 bool generate_event);
This abstract base class represents connection channel information about a new connection.
Definition: channel_info.h:47
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
bool do_command(THD *thd)
Read one command from connection and execute it (query or simple command).
Definition: sql_parse.cc:1321
struct PSI_thread PSI_thread
Definition: psi_thread_bits.h:82
uint64_t uint64
Definition: my_inttypes.h:69
pthread_attr_t my_thread_attr_t
Definition: my_thread_bits.h:49
int my_socket
Definition: mysql.h:65
This structure must be populated by plugins which implement connection handlers and passed as an argu...
Definition: thread_pool_priv.h:64
uint max_threads
The maximum number of threads this connection handler will create.
Definition: thread_pool_priv.h:68
add_connection_t add_connection
Definition: thread_pool_priv.h:70
end_t end
Definition: thread_pool_priv.h:71
void(* end_t)(void)
Called by the server when the connection handler is destroyed.
Definition: thread_pool_priv.h:52
bool thd_prepare_connection(THD *thd)
Definition: sql_connect.cc:893
PSI_thread * thd_get_psi(THD *thd)
Get reference to Performance Schema object for THD object.
Definition: sql_thd_api.cc:110
void do_for_all_thd(do_thd_impl_uint64, uint64)
Definition: mysqld_thd_manager.cc:397
ulong get_max_connections(void)
Get max number of connections.
Definition: sql_thd_api.cc:302
bool thd_in_active_multi_stmt_transaction(const THD *)
Predicate for determining if connection is in active multi-statement transaction.
Definition: sql_thd_api.cc:223
void close_connection(THD *thd, uint sql_errno, bool server_shutdown, bool generate_event)
Close a connection.
Definition: sql_connect.cc:918
ulong thd_get_net_wait_timeout(THD *thd)
Get net_wait_timeout for THD object.
Definition: sql_thd_api.cc:120
THD * thd_get_current_thd()
Get current THD object from thread local data.
Definition: sql_thd_api.cc:178
void * thd_get_scheduler_data(THD *thd)
Get reference to scheduler data object.
Definition: sql_thd_api.cc:89
my_thread_attr_t * get_connection_attrib(void)
Get thread attributes for connection threads.
Definition: sql_thd_api.cc:294
void reset_thread_globals(THD *thd)
Reset thread globals associated.
Definition: sql_thd_api.cc:186
void thd_lock_thread_count()
Definition: mysqld_thd_manager.cc:370
uint thd_get_net_read_write(THD *thd)
Get reading/writing on socket from THD object.
Definition: sql_thd_api.cc:245
void thd_lock_data(THD *thd)
Lock data that needs protection in THD object.
Definition: sql_thd_api.cc:197
void thd_close_connection(THD *thd)
Close the socket used by this connection.
Definition: sql_thd_api.cc:167
void mysql_audit_release(THD *thd)
Release any resources associated with the current thd.
Definition: sql_audit.cc:609
void thd_set_killed(THD *thd)
Set the state on connection to killed.
Definition: sql_thd_api.cc:139
void increment_aborted_connects()
Definition: connection_handler_manager.cc:283
bool(* add_connection_t)(Channel_info *channel_info)
Called by the server when a new client connects.
Definition: thread_pool_priv.h:47
void thd_set_not_killable(THD *thd)
Mark the THD as not killable as it is not currently used by a thread.
Definition: sql_thd_api.cc:266
void thd_unlock_data(THD *thd)
Unlock data that needs protection in THD object.
Definition: sql_thd_api.cc:205
THD * create_thd(Channel_info *channel_info)
Definition: connection_handler_manager.cc:269
bool thd_connection_alive(THD *thd)
Definition: sql_connect.cc:936
int thd_connection_has_data(THD *thd)
Check if there is buffered data on the socket representing the connection.
Definition: sql_thd_api.cc:233
void end_connection(THD *thd)
Definition: sql_connect.cc:733
void thd_set_net_read_write(THD *thd, uint val)
Set reading/writing on socket, used by SHOW PROCESSLIST.
Definition: sql_thd_api.cc:256
void() do_thd_impl_uint64(THD *, uint64)
Definition: thread_pool_priv.h:97
my_socket thd_get_fd(THD *thd)
Get socket file descriptor for this connection.
Definition: sql_thd_api.cc:276
void thd_unlock_thread_count()
Definition: mysqld_thd_manager.cc:375
void destroy_channel_info(Channel_info *channel_info)
Definition: connection_handler_manager.cc:277
void thd_set_psi(THD *thd, PSI_thread *psi)
Set reference to Performance Schema object for THD object.
Definition: sql_thd_api.cc:131
void thd_set_scheduler_data(THD *thd, void *data)
Set reference to Scheduler data object for THD object.
Definition: sql_thd_api.cc:98
bool thd_is_transaction_active(THD *thd)
Support method to check if connection has already started transaction.
Definition: sql_thd_api.cc:215
bool thd_check_connection_admin_privilege(THD *thd)
void dec_connection_count()
Definition: connection_handler_manager.cc:279
void thd_clear_errors(THD *thd)
Clear errors from the previous THD.
Definition: sql_thd_api.cc:158
void thd_store_globals(THD *thd)
Set thread specific environment required for thd cleanup in thread pool.
Definition: sql_thd_api.cc:286
void inc_thread_created()
Definition: mysqld_thd_manager.cc:366
bool connection_events_loop_aborted()
Definition: mysqld.h:746