summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-07-11 21:33:19 -0600
committerunknown <sasha@mysql.sashanet.com>2001-07-11 21:33:19 -0600
commit7cc86549bce7f503b592ef1c5cdb660ed7864e25 (patch)
tree289e7989f1fb502abeee561e85a84e4dfbb008bd /sql/slave.cc
parent083f283cebde7cafef02ea211d0a474779985799 (diff)
downloadmariadb-git-7cc86549bce7f503b592ef1c5cdb660ed7864e25.tar.gz
send kill signal to slave thread on shutdown
sql/slave.cc: fixed bug in end_slave() - must send kill signal to slave thread
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index d758db1abd1..17420b8fde9 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -190,8 +190,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);