1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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
This commit is contained in:
Vladislav Vaintroub
2012-12-21 00:12:37 +01:00
parent 1b2692d0e9
commit 21b4fda3a5
4 changed files with 16 additions and 22 deletions

View File

@ -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);
/*