mdev-208 thread pool breaks the server on XP
This commit is contained in:
parent
34ed8f3379
commit
b43494620f
@ -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);
|
|||||||
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user