2863
@param session Thread handle
2864
@param errcode Error code to print to console
2865
@param lock 1 if we have have to lock LOCK_thread_count
2868
For the connection that is doing shutdown, this is called twice
2870
void close_connection(Session *session, uint32_t errcode, bool lock)
2874
(void) pthread_mutex_lock(&LOCK_thread_count);
2875
session->killed= Session::KILL_CONNECTION;
2876
if ((vio= session->net.vio) != 0)
2879
net_send_error(session, errcode, ER(errcode)); /* purecov: inspected */
2880
net_close(&(session->net)); /* vio is freed in delete session */
2883
(void) pthread_mutex_unlock(&LOCK_thread_count);