File tree Expand file tree Collapse file tree 4 files changed +6
-7
lines changed Expand file tree Collapse file tree 4 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -9597,9 +9597,7 @@ binlog_background_thread(void *arg __attribute__((unused)))
9597
9597
9598
9598
THD_STAGE_INFO (thd, stage_binlog_stopping_background_thread);
9599
9599
9600
- mysql_mutex_lock (&LOCK_thread_count);
9601
9600
delete thd;
9602
- mysql_mutex_unlock (&LOCK_thread_count);
9603
9601
9604
9602
my_thread_end ();
9605
9603
Original file line number Diff line number Diff line change @@ -4630,6 +4630,7 @@ static int init_thread_environment()
4630
4630
mysql_mutex_init (key_LOCK_global_system_variables,
4631
4631
&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
4632
4632
mysql_mutex_record_order (&LOCK_active_mi, &LOCK_global_system_variables);
4633
+ mysql_mutex_record_order (&LOCK_status, &LOCK_thread_count);
4633
4634
mysql_rwlock_init (key_rwlock_LOCK_system_variables_hash,
4634
4635
&LOCK_system_variables_hash);
4635
4636
mysql_mutex_init (key_LOCK_prepared_stmt_count,
Original file line number Diff line number Diff line change @@ -1372,10 +1372,11 @@ handle_rpl_parallel_thread(void *arg)
1372
1372
thd->reset_db (NULL , 0 );
1373
1373
thd_proc_info (thd, " Slave worker thread exiting" );
1374
1374
thd->temporary_tables = 0 ;
1375
+
1375
1376
mysql_mutex_lock (&LOCK_thread_count);
1376
- THD_CHECK_SENTRY (thd);
1377
- delete thd;
1377
+ thd->unlink ();
1378
1378
mysql_mutex_unlock (&LOCK_thread_count);
1379
+ delete thd;
1379
1380
1380
1381
mysql_mutex_lock (&rpt->LOCK_rpl_thread );
1381
1382
rpt->running = false ;
Original file line number Diff line number Diff line change @@ -311,9 +311,7 @@ handle_slave_init(void *arg __attribute__((unused)))
311
311
thd->get_stmt_da ()->sql_errno (),
312
312
thd->get_stmt_da ()->message ());
313
313
314
- mysql_mutex_lock (&LOCK_thread_count);
315
314
delete thd;
316
- mysql_mutex_unlock (&LOCK_thread_count);
317
315
thread_safe_decrement32 (&service_thread_count);
318
316
signal_thd_deleted ();
319
317
my_thread_end ();
@@ -4961,8 +4959,9 @@ pthread_handler_t handle_slave_sql(void *arg)
4961
4959
mysql_mutex_unlock (&LOCK_active_mi);
4962
4960
4963
4961
mysql_mutex_lock (&LOCK_thread_count);
4964
- delete thd;
4962
+ thd-> unlink () ;
4965
4963
mysql_mutex_unlock (&LOCK_thread_count);
4964
+ delete thd;
4966
4965
thread_safe_decrement32 (&service_thread_count);
4967
4966
signal_thd_deleted ();
4968
4967
You can’t perform that action at this time.
0 commit comments