Skip to content

Commit 1ab711b

Browse files
committed
Corrected freeing of thd when running with wsrep and thread pool
This is needed because of the new code where THD creation was moved to the new thread
1 parent 70a4856 commit 1ab711b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sql/wsrep_mysqld.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,14 +1847,15 @@ pthread_handler_t start_wsrep_THD(void *arg)
18471847
// at server shutdown
18481848
}
18491849

1850-
my_thread_end();
18511850
if (thread_handling > SCHEDULER_ONE_THREAD_PER_CONNECTION)
18521851
{
18531852
mysql_mutex_lock(&LOCK_thread_count);
1854-
delete thd;
1855-
thread_count--;
1853+
thd->unlink();
18561854
mysql_mutex_unlock(&LOCK_thread_count);
1855+
delete thd;
1856+
dec_thread_count();
18571857
}
1858+
my_thread_end();
18581859
return(NULL);
18591860

18601861
error:

0 commit comments

Comments
 (0)