summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-02-28 18:08:55 +0100
committerunknown <serg@serg.mylan>2004-02-28 18:08:55 +0100
commit89add1df32ca91617e92e99cc860e825ae647df7 (patch)
tree5bbdd4277f47eff4d38290c36079ea33c8b267a9 /sql/mysqld.cc
parent31531bfae5aa3e5006ccf063db2f270aaa3ba9d3 (diff)
downloadmariadb-git-89add1df32ca91617e92e99cc860e825ae647df7.tar.gz
update max_used_connections *after* thread_count was increased to take into account the current connection
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 00d21560e75..5071cfaff6b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2951,8 +2951,6 @@ static void create_new_thread(THD *thd)
DBUG_VOID_RETURN;
}
pthread_mutex_lock(&LOCK_thread_count);
- if (thread_count-delayed_insert_threads > max_used_connections)
- max_used_connections=thread_count-delayed_insert_threads;
thd->thread_id=thread_id++;
thd->real_id=pthread_self(); // Keep purify happy
@@ -2981,6 +2979,8 @@ static void create_new_thread(THD *thd)
thread_count++;
thread_created++;
threads.append(thd);
+ if (thread_count-delayed_insert_threads > max_used_connections)
+ max_used_connections=thread_count-delayed_insert_threads;
DBUG_PRINT("info",(("creating thread %d"), thd->thread_id));
thd->connect_time = time(NULL);
if ((error=pthread_create(&thd->real_id,&connection_attrib,