mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
signal slave thread to stop during shutdown
This commit is contained in:
parent
ab63258610
commit
c0b4b2360c
1 changed files with 10 additions and 2 deletions
12
sql/slave.cc
12
sql/slave.cc
|
@ -191,8 +191,16 @@ static void free_string_array(DYNAMIC_ARRAY *a)
|
|||
void end_slave()
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_slave);
|
||||
while (slave_running)
|
||||
pthread_cond_wait(&COND_slave_stopped, &LOCK_slave);
|
||||
if (slave_running)
|
||||
{
|
||||
abort_slave = 1;
|
||||
thr_alarm_kill(slave_real_id);
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
slave_thd->close_active_vio();
|
||||
#endif
|
||||
while (slave_running)
|
||||
pthread_cond_wait(&COND_slave_stopped, &LOCK_slave);
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_slave);
|
||||
|
||||
end_master_info(&glob_mi);
|
||||
|
|
Loading…
Add table
Reference in a new issue