summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2014-07-22 10:49:28 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2014-07-22 10:49:28 +0500
commit4ad2abc55b0d9ae7f41ee02299f2fbce00da256f (patch)
tree04d52e5023c3ac7ce4f86b87c97c172b33975833 /sql
parent0bb0230e3a08d6901774e263c00bdd4448defe80 (diff)
downloadmariadb-git-4ad2abc55b0d9ae7f41ee02299f2fbce00da256f.tar.gz
MDEV-5756 CMake option to build without thread pool.
Check if the threadpool is available on the system and set HAVE_POOL_OF_THREADS respectively.
Diffstat (limited to 'sql')
-rw-r--r--sql/CMakeLists.txt10
-rw-r--r--sql/scheduler.h6
2 files changed, 11 insertions, 5 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 2cf2fc2d133..d07b2106f07 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -30,7 +30,15 @@ ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
-ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER -DHAVE_POOL_OF_THREADS)
+ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER)
+
+IF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR
+ CMAKE_SYSTEM_NAME MATCHES "Windows" OR
+ CMAKE_SYSTEM_NAME MATCHES "SunOS" OR
+ HAVE_KQUEUE)
+ ADD_DEFINITIONS(-DHAVE_POOL_OF_THREADS)
+ENDIF()
+
IF(SSL_DEFINES)
ADD_DEFINITIONS(${SSL_DEFINES})
ENDIF()
diff --git a/sql/scheduler.h b/sql/scheduler.h
index 06c17c7b114..f7aff377eac 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -99,15 +99,13 @@ public:
void *data; /* scheduler-specific data structure */
};
-#undef HAVE_POOL_OF_THREADS
-#if !defined(EMBEDDED_LIBRARY) && !defined(_AIX)
-#define HAVE_POOL_OF_THREADS 1
+#ifdef HAVE_POOL_OF_THREADS
void pool_of_threads_scheduler(scheduler_functions* func,
ulong *arg_max_connections,
uint *arg_connection_count);
#else
#define pool_of_threads_scheduler(A,B,C) \
one_thread_per_connection_scheduler(A, B, C)
-#endif
+#endif /*HAVE_POOL_OF_THREADS*/
#endif /* SCHEDULER_INCLUDED */