summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/threadpool_win.cc3
2 files changed, 11 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 90d97558e27..3233ffdc5d3 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -7937,6 +7937,14 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
one_thread_scheduler(thread_scheduler);
one_thread_scheduler(extra_thread_scheduler);
#else
+
+#ifdef _WIN32
+ /* workaround: disable thread pool on XP */
+ if (GetProcAddress(GetModuleHandle("kernel32"),"CreateThreadpool") == 0 &&
+ thread_handling > SCHEDULER_NO_THREADS)
+ thread_handling = SCHEDULER_ONE_THREAD_PER_CONNECTION;
+#endif
+
if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION)
one_thread_per_connection_scheduler(thread_scheduler, &max_connections,
&connection_count);
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc
index 346f2816e39..c8cc38e612a 100644
--- a/sql/threadpool_win.cc
+++ b/sql/threadpool_win.cc
@@ -144,6 +144,9 @@ WEAK_SYMBOL(VOID, SubmitThreadpoolWork,PTP_WORK pwk);
WEAK_SYMBOL(VOID, CloseThreadpoolWork, PTP_WORK pwk);
#define CloseThreadpoolWork my_CloseThreadpoolWork
+WEAK_SYMBOL(BOOL, CallbackMayRunLong, PTP_CALLBACK_INSTANCE pci);
+#define CallbackMayRunLong my_CallbackMayRunLong
+
#if _MSC_VER >= 1600
/* Stack size manipulation available only on Win7+ /declarations in VS10 */
WEAK_SYMBOL(BOOL, SetThreadpoolStackInformation, PTP_POOL,