Removed some not needed when doing delete thd, which caused warnings about

wrong mutex usage from safe_mutex.
Ensure that LOCK_status is always taken before LOCK_thread_count
This commit is contained in:
Monty 2016-04-28 13:39:05 +03:00
parent b4ff64568c
commit 732adec0a4
4 changed files with 6 additions and 7 deletions

View File

@ -9597,9 +9597,7 @@ binlog_background_thread(void *arg __attribute__((unused)))
THD_STAGE_INFO(thd, stage_binlog_stopping_background_thread);
mysql_mutex_lock(&LOCK_thread_count);
delete thd;
mysql_mutex_unlock(&LOCK_thread_count);
my_thread_end();

View File

@ -4630,6 +4630,7 @@ static int init_thread_environment()
mysql_mutex_init(key_LOCK_global_system_variables,
&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
mysql_mutex_record_order(&LOCK_active_mi, &LOCK_global_system_variables);
mysql_mutex_record_order(&LOCK_status, &LOCK_thread_count);
mysql_rwlock_init(key_rwlock_LOCK_system_variables_hash,
&LOCK_system_variables_hash);
mysql_mutex_init(key_LOCK_prepared_stmt_count,

View File

@ -1372,10 +1372,11 @@ handle_rpl_parallel_thread(void *arg)
thd->reset_db(NULL, 0);
thd_proc_info(thd, "Slave worker thread exiting");
thd->temporary_tables= 0;
mysql_mutex_lock(&LOCK_thread_count);
THD_CHECK_SENTRY(thd);
delete thd;
thd->unlink();
mysql_mutex_unlock(&LOCK_thread_count);
delete thd;
mysql_mutex_lock(&rpt->LOCK_rpl_thread);
rpt->running= false;

View File

@ -311,9 +311,7 @@ handle_slave_init(void *arg __attribute__((unused)))
thd->get_stmt_da()->sql_errno(),
thd->get_stmt_da()->message());
mysql_mutex_lock(&LOCK_thread_count);
delete thd;
mysql_mutex_unlock(&LOCK_thread_count);
thread_safe_decrement32(&service_thread_count);
signal_thd_deleted();
my_thread_end();
@ -4961,8 +4959,9 @@ err_during_init:
mysql_mutex_unlock(&LOCK_active_mi);
mysql_mutex_lock(&LOCK_thread_count);
delete thd;
thd->unlink();
mysql_mutex_unlock(&LOCK_thread_count);
delete thd;
thread_safe_decrement32(&service_thread_count);
signal_thd_deleted();