Skip to content

Commit

Permalink
Merge pull request #152 from zhang-lujie/kp-5.7-thread-pool-dev-kp
Browse files Browse the repository at this point in the history
[Issue#147]Fix the bug of threadpool shutdown may be incomplete.
  • Loading branch information
zwang28 authored Sep 2, 2021
2 parents a0e81c6 + b96fe70 commit c048096
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sql/threadpool_unix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1028,14 +1028,13 @@ static void thread_group_close(thread_group_t *thread_group)
DBUG_ENTER("thread_group_close");

mysql_mutex_lock(&thread_group->mutex);
thread_group->shutdown = true;
if (thread_group->thread_count == 0)
{
mysql_mutex_unlock(&thread_group->mutex);
DBUG_VOID_RETURN;
}

thread_group->shutdown= true;

if (pipe(thread_group->shutdown_pipe))
{
mysql_mutex_unlock(&thread_group->mutex);
Expand Down

0 comments on commit c048096

Please sign in to comment.