Commit b4349462 authored by Sergei Golubchik's avatar Sergei Golubchik

mdev-208 thread pool breaks the server on XP

parent 34ed8f33
...@@ -7937,6 +7937,14 @@ static int get_options(int *argc_ptr, char ***argv_ptr) ...@@ -7937,6 +7937,14 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
one_thread_scheduler(thread_scheduler); one_thread_scheduler(thread_scheduler);
one_thread_scheduler(extra_thread_scheduler); one_thread_scheduler(extra_thread_scheduler);
#else #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) if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION)
one_thread_per_connection_scheduler(thread_scheduler, &max_connections, one_thread_per_connection_scheduler(thread_scheduler, &max_connections,
&connection_count); &connection_count);
......
...@@ -144,6 +144,9 @@ WEAK_SYMBOL(VOID, SubmitThreadpoolWork,PTP_WORK pwk); ...@@ -144,6 +144,9 @@ WEAK_SYMBOL(VOID, SubmitThreadpoolWork,PTP_WORK pwk);
WEAK_SYMBOL(VOID, CloseThreadpoolWork, PTP_WORK pwk); WEAK_SYMBOL(VOID, CloseThreadpoolWork, PTP_WORK pwk);
#define CloseThreadpoolWork my_CloseThreadpoolWork #define CloseThreadpoolWork my_CloseThreadpoolWork
WEAK_SYMBOL(BOOL, CallbackMayRunLong, PTP_CALLBACK_INSTANCE pci);
#define CallbackMayRunLong my_CallbackMayRunLong
#if _MSC_VER >= 1600 #if _MSC_VER >= 1600
/* Stack size manipulation available only on Win7+ /declarations in VS10 */ /* Stack size manipulation available only on Win7+ /declarations in VS10 */
WEAK_SYMBOL(BOOL, SetThreadpoolStackInformation, PTP_POOL, WEAK_SYMBOL(BOOL, SetThreadpoolStackInformation, PTP_POOL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment