2285
2285
thread_count++;
2287
thread_scheduler.add_connection(session);
2288
If we error on creation we drop the connection and delete the session.
2290
if (thread_scheduler.add_connection(session))
2292
char error_message_buff[DRIZZLE_ERRMSG_SIZE];
2294
session->killed= Session::KILL_CONNECTION; // Safety
2296
statistic_increment(aborted_connects, &LOCK_status);
2298
/* Can't use my_error() since store_globals has not been called. */
2299
snprintf(error_message_buff, sizeof(error_message_buff), ER(ER_CANT_CREATE_THREAD), 1); /* TODO replace will better error message */
2300
net_send_error(session, ER_CANT_CREATE_THREAD, error_message_buff);
2301
(void) pthread_mutex_lock(&LOCK_thread_count);
2303
session->close_connection(0, 0);
2305
(void) pthread_mutex_unlock(&LOCK_thread_count);