summaryrefslogtreecommitdiff
path: root/sql/threadpool_common.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-12-21 00:12:37 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-12-21 00:12:37 +0100
commit21b4fda3a565ca3d43ae6ac77df06e69076b0f8d (patch)
tree6b6b77bae7a02a0e32817deb138da947b701f963 /sql/threadpool_common.cc
parent1b2692d0e9f99d7cb2dbcdb8d030345679affbfc (diff)
downloadmariadb-git-21b4fda3a565ca3d43ae6ac77df06e69076b0f8d.tar.gz
MDEV-3945 - do not hold LOCK_thread_count when freeing THD.
The patch decreases the duration of LOCK_thread_count, so it is not hold during THD destructor and freeing memory. This mutex now only protects the integrity of threads list, when removing THD from it, and thread_count variable. The add_to_status() function that updates global status during client disconnect, is now correctly protected by the LOCK_status mutex. Benchmark : in a "non-persistent" sysbench test (oltp_ro with reconnect after each query), ~ 25% more connects/disconnects were measured
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r--sql/threadpool_common.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 6b956768287..147a59df9b7 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -173,7 +173,6 @@ void threadpool_remove_connection(THD *thd)
close_connection(thd, 0);
unlink_thd(thd);
- mysql_mutex_unlock(&LOCK_thread_count);
mysql_cond_broadcast(&COND_thread_count);
/*