diff options
author | unknown <sasha@mysql.sashanet.com> | 2002-03-26 22:23:51 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2002-03-26 22:23:51 -0700 |
commit | 5d8b325033c00d484b5f0f120bfa057fcfec6660 (patch) | |
tree | addd464870d8ce2dc41b174031430761b68ff23e /sql/slave.cc | |
parent | 028687a3b0778cb07aaea4c899f3842bad87d58c (diff) | |
parent | 831ead396936f54d5938f40f539bc34046cc399a (diff) | |
download | mariadb-git-5d8b325033c00d484b5f0f120bfa057fcfec6660.tar.gz |
Merge work:/home/bk/mysql-4.0
into mysql.sashanet.com:/reiser-data/mysql-4.0
sql/lex.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 176f5db2f79..9050bf7362f 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -345,7 +345,13 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, } } DBUG_ASSERT(thd != 0); - KICK_SLAVE(thd); + /* is is criticate to test if the slave is running. Otherwise, we might + be referening freed memory trying to kick it + */ + if (*slave_running) + { + KICK_SLAVE(thd); + } while (*slave_running) { /* there is a small chance that slave thread might miss the first @@ -367,7 +373,9 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, DBUG_ASSERT_LOCK(cond_lock); pthread_cond_timedwait(term_cond, cond_lock, &abstime); if (*slave_running) + { KICK_SLAVE(thd); + } } if (term_lock) pthread_mutex_unlock(term_lock); |