summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-04-18 05:50:59 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2019-04-18 07:37:05 +0100
commit6812fb7971a247592358f36ee8ae23dfea565a36 (patch)
treebdc81c3d3a57d82de08eb17d7542b97d16b8db1e
parent59ed5f3aa4bc5a02a65f93b1d054ccc0fb2cd248 (diff)
downloadmariadb-git-6812fb7971a247592358f36ee8ae23dfea565a36.tar.gz
MDEV-19274 mariadb does not build on OSes that do not have HAVE_POOL_OF_THREADSbb-10.4-aix-build-fix
Do not try to compile threadpool_common.cc, if threadpool is not available on current OS. Also introduced undocumented/uncached CMake variable DISABLE_THREADPOOL, to emulate builds on exotic OSes.
-rw-r--r--sql/CMakeLists.txt16
-rw-r--r--sql/handle_connections_win.cc5
-rw-r--r--sql/threadpool.h7
3 files changed, 22 insertions, 6 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index ecca723b9e4..da4de86d950 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -126,7 +126,7 @@ SET (SQL_SOURCE
opt_index_cond_pushdown.cc opt_subselect.cc
opt_table_elimination.cc sql_expression_cache.cc
gcalc_slicescan.cc gcalc_tools.cc
- threadpool_common.cc ../sql-common/mysql_async.c
+ ../sql-common/mysql_async.c
my_apc.cc mf_iocache_encr.cc item_jsonfunc.cc
my_json_writer.cc
rpl_gtid.cc rpl_parallel.cc
@@ -152,17 +152,21 @@ SET (SQL_SOURCE
${MYSYS_LIBWRAP_SOURCE}
)
-IF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR
- CMAKE_SYSTEM_NAME MATCHES "Windows" OR
- CMAKE_SYSTEM_NAME MATCHES "SunOS" OR
- HAVE_KQUEUE)
+IF ((CMAKE_SYSTEM_NAME MATCHES "Linux" OR
+ CMAKE_SYSTEM_NAME MATCHES "SunOS" OR
+ WIN32 OR
+ HAVE_KQUEUE)
+ AND (NOT DISABLE_THREADPOOL))
ADD_DEFINITIONS(-DHAVE_POOL_OF_THREADS)
IF(WIN32)
SET(SQL_SOURCE ${SQL_SOURCE} threadpool_win.cc)
- SET(SQL_SOURCE ${SQL_SOURCE} handle_connections_win.cc)
ENDIF()
SET(SQL_SOURCE ${SQL_SOURCE} threadpool_generic.cc)
+ SET(SQL_SOURCE ${SQL_SOURCE} threadpool_common.cc)
+ENDIF()
+IF(WIN32)
+ SET(SQL_SOURCE ${SQL_SOURCE} handle_connections_win.cc)
ENDIF()
MYSQL_ADD_PLUGIN(partition ha_partition.cc STORAGE_ENGINE DEFAULT STATIC_ONLY
diff --git a/sql/handle_connections_win.cc b/sql/handle_connections_win.cc
index 6724a2a1f30..e5b601d7fe0 100644
--- a/sql/handle_connections_win.cc
+++ b/sql/handle_connections_win.cc
@@ -28,8 +28,13 @@
/* From mysqld.cc */
extern HANDLE hEventShutdown;
extern MYSQL_SOCKET base_ip_sock, extra_ip_sock;
+#ifdef HAVE_POOL_OF_THREADS
extern PTP_CALLBACK_ENVIRON get_threadpool_win_callback_environ();
extern void tp_win_callback_prolog();
+#else
+#define get_threadpool_win_callback_environ() 0
+#define tp_win_callback_prolog() do{}while(0)
+#endif
static SECURITY_ATTRIBUTES pipe_security;
/**
diff --git a/sql/threadpool.h b/sql/threadpool.h
index ba17dc042c2..57750b73e42 100644
--- a/sql/threadpool.h
+++ b/sql/threadpool.h
@@ -1,3 +1,7 @@
+#ifndef THREADPOOL_H_INCLUDED
+#define THREADPOOL_H_INCLUDED
+
+#ifdef HAVE_POOL_OF_THREADS
/* Copyright (C) 2012 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -154,3 +158,6 @@ struct TP_pool_generic :TP_pool
virtual int set_stall_limit(uint);
virtual int get_idle_thread_count();
};
+
+#endif /* HAVE_POOL_OF_THREADS */
+#endif /* THREADPOOL_H_INCLUDED */