diff options
Diffstat (limited to 'sql/threadpool_common.cc')
| -rw-r--r-- | sql/threadpool_common.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 7e3492ae3ef..730ea2bd365 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -344,15 +344,17 @@ static bool tp_end_thread(THD *, bool) return 0; } -TP_pool *pool; +static TP_pool *pool; static bool tp_init() { + #ifdef _WIN32 pool = new (std::nothrow) TP_pool_win; return 0; #else -#error No threadpool + pool= new (std::nothrow) TP_pool_unix; + return 0; #endif } @@ -389,6 +391,19 @@ void tp_set_max_threads(uint val) pool->set_max_threads(val); } +void tp_set_threadpool_size(uint val) +{ + if (pool) + pool->set_pool_size(val); +} + + +void tp_set_threadpool_stall_limit(uint val) +{ + if (pool) + pool->set_stall_limit(val); +} + void tp_timeout_handler(TP_connection *c) { @@ -433,6 +448,7 @@ static void tp_end() delete pool; } + static scheduler_functions tp_scheduler_functions= { 0, // max_threads |
