diff options
Diffstat (limited to 'sql/threadpool_unix.cc')
-rw-r--r-- | sql/threadpool_unix.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index 3a90f24f6e9..7b10785dd17 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -19,6 +19,9 @@ #include <sql_class.h> #include <my_pthread.h> #include <scheduler.h> + +#ifdef HAVE_POOL_OF_THREADS + #include <sql_connect.h> #include <mysqld.h> #include <debug_sync.h> @@ -1256,7 +1259,7 @@ void tp_add_connection(THD *thd) else { /* Allocation failed */ - threadpool_remove_connection(thd); + threadpool_cleanup_connection(thd); } DBUG_VOID_RETURN; } @@ -1370,7 +1373,7 @@ static int change_group(connection_t *c, thread_group_t *new_group) { int ret= 0; - int fd = c->thd->net.vio->sd; + int fd= mysql_socket_getfd(c->thd->net.vio->mysql_socket); DBUG_ASSERT(c->thread_group == old_group); @@ -1398,7 +1401,7 @@ static int change_group(connection_t *c, static int start_io(connection_t *connection) { - int fd = connection->thd->net.vio->sd; + int fd = mysql_socket_getfd(connection->thd->net.vio->mysql_socket); /* Usually, connection will stay in the same group for the entire @@ -1518,7 +1521,7 @@ static void *worker_main(void *param) bool tp_init() { DBUG_ENTER("tp_init"); - threadpool_max_size= max(threadpool_size, 128); + threadpool_max_size= MY_MAX(threadpool_size, 128); all_groups= (thread_group_t *) my_malloc(sizeof(thread_group_t) * threadpool_max_size, MYF(MY_WME|MY_ZEROFILL)); if (!all_groups) @@ -1635,7 +1638,7 @@ int tp_get_idle_thread_count() Delay in microseconds, after which "pool blocked" message is printed. (30 sec == 30 Mio usec) */ -#define BLOCK_MSG_DELAY 30*1000000 +#define BLOCK_MSG_DELAY (30*1000000) #define MAX_THREADS_REACHED_MSG \ "Threadpool could not create additional thread to handle queries, because the \ @@ -1682,3 +1685,5 @@ static void print_pool_blocked_message(bool max_threads_reached) msg_written= true; } } + +#endif /* HAVE_POOL_OF_THREADS */ |