diff options
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | sql/sql_list.h | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f45614bd0a1..f4649a792b4 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2091,7 +2091,6 @@ static void create_new_thread(THD *thd) threads.append(thd); DBUG_PRINT("info",(("creating thread %d"), thd->thread_id)); thd->connect_time = time(NULL); - (void) pthread_mutex_unlock(&LOCK_thread_count); if ((error=pthread_create(&thd->real_id,&connection_attrib, handle_one_connection, (void*) thd))) @@ -2099,7 +2098,6 @@ static void create_new_thread(THD *thd) DBUG_PRINT("error", ("Can't create thread to handle request (error %d)", error)); - (void) pthread_mutex_lock(&LOCK_thread_count); thread_count--; thd->killed=1; // Safety (void) pthread_mutex_unlock(&LOCK_thread_count); @@ -2110,6 +2108,8 @@ static void create_new_thread(THD *thd) (void) pthread_mutex_unlock(&LOCK_thread_count); DBUG_VOID_RETURN; } + + (void) pthread_mutex_unlock(&LOCK_thread_count); } } DBUG_PRINT("info",(("Thread %d created"), thd->thread_id)); diff --git a/sql/sql_list.h b/sql/sql_list.h index 965d1ff9308..b86250f70b6 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -225,6 +225,15 @@ public: struct ilink { struct ilink **prev,*next; + static void *operator new(size_t size) + { + return (void*)my_malloc((uint)size, MYF(MY_WME | MY_FAE)); + } + static void operator delete(void* ptr_arg, size_t size) + { + my_free((gptr)ptr_arg, MYF(MY_WME|MY_ALLOW_ZERO_PTR)); + } + inline ilink() { prev=0; next=0; |