From 189fa3008567811706b98db0078dc4847bfd3bc7 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 17 Dec 2019 21:57:40 +0100 Subject: [PATCH] MDEV-21343 Threadpool/Unix- wait_begin() function does not wake/create threads, when it should Fixed the condition for waking up/creating another thread. If there is some work to do (if the request queue is not empty), a thread should be woken or created. The condition was incorrect since 18c9b345b43b62b7c4dbac8ce0289c1c8103c2d1 --- sql/threadpool_generic.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc index 434857447a4..02eb336facb 100644 --- a/sql/threadpool_generic.cc +++ b/sql/threadpool_generic.cc @@ -1339,7 +1339,7 @@ void wait_begin(thread_group_t *thread_group) DBUG_ASSERT(thread_group->connection_count > 0); if ((thread_group->active_thread_count == 0) && - (is_queue_empty(thread_group) || !thread_group->listener)) + (!is_queue_empty(thread_group) || !thread_group->listener)) { /* Group might stall while this thread waits, thus wake