summaryrefslogtreecommitdiff
path: root/sql/threadpool_common.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2016-07-16 23:33:31 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2016-07-16 23:33:31 +0000
commit453c9e163acb604aab4deddd45479dcc68c0d9de (patch)
tree068fcb88da1f0e346f20eb28b1ece45b27def299 /sql/threadpool_common.cc
parent139534a50b91b2b90baab33ad997fbd09414e48c (diff)
downloadmariadb-git-10.2-wlad-threadpool.tar.gz
fix connection counter in unix pool, return error code from tp_init instead of exit()10.2-wlad-threadpool
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r--sql/threadpool_common.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 730ea2bd365..e3f968003b7 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -351,11 +351,18 @@ static bool tp_init()
#ifdef _WIN32
pool = new (std::nothrow) TP_pool_win;
- return 0;
#else
pool= new (std::nothrow) TP_pool_unix;
- return 0;
#endif
+ if (!pool)
+ return true;
+ if (pool->init())
+ {
+ delete pool;
+ pool= 0;
+ return true;
+ }
+ return false;
}
static void tp_add_connection(CONNECT *connect)