From 80c97f8c0c496a4ef9372172704b7d0d9115325f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 17 Dec 2019 22:36:26 +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 18c9b34 --- sql/threadpool_unix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index b505ec3dff5..3a90f24f6e9 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -1173,7 +1173,7 @@ void wait_begin(thread_group_t *thread_group) DBUG_ASSERT(thread_group->connection_count > 0); if ((thread_group->active_thread_count == 0) && - (thread_group->queue.is_empty() || !thread_group->listener)) + (!thread_group->queue.is_empty() || !thread_group->listener)) { /* Group might stall while this thread waits, thus wake