summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-05-11 19:28:58 +0200
committerSergei Golubchik <serg@mariadb.org>2016-06-04 09:06:00 +0200
commit4a0612ed2ab95305668a56b1d300526c7b595a29 (patch)
treef18ae409adea7dfe72028a643f48beb0551fef8a /sql/log.cc
parent562c1df7d97cb23145e09b3482fd18d49476752d (diff)
downloadmariadb-git-bb-fast-connect.tar.gz
stop binlog background thread together with othersbb-fast-connect
that fixes many rpl tests failures
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc28
1 files changed, 17 insertions, 11 deletions
diff --git a/sql/log.cc b/sql/log.cc
index aed30e2bb39..c81869a57e7 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -3171,6 +3171,21 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period)
bzero((char*) &purge_index_file, sizeof(purge_index_file));
}
+void MYSQL_BIN_LOG::stop_background_thread()
+{
+ if (binlog_background_thread_started)
+ {
+ mysql_mutex_lock(&LOCK_binlog_background_thread);
+ binlog_background_thread_stop= true;
+ mysql_cond_signal(&COND_binlog_background_thread);
+ while (binlog_background_thread_stop)
+ mysql_cond_wait(&COND_binlog_background_thread_end,
+ &LOCK_binlog_background_thread);
+ mysql_mutex_unlock(&LOCK_binlog_background_thread);
+ binlog_background_thread_started= false;
+ }
+}
+
/* this is called only once */
void MYSQL_BIN_LOG::cleanup()
@@ -3181,17 +3196,8 @@ void MYSQL_BIN_LOG::cleanup()
xid_count_per_binlog *b;
/* Wait for the binlog background thread to stop. */
- if (!is_relay_log && binlog_background_thread_started)
- {
- mysql_mutex_lock(&LOCK_binlog_background_thread);
- binlog_background_thread_stop= true;
- mysql_cond_signal(&COND_binlog_background_thread);
- while (binlog_background_thread_stop)
- mysql_cond_wait(&COND_binlog_background_thread_end,
- &LOCK_binlog_background_thread);
- mysql_mutex_unlock(&LOCK_binlog_background_thread);
- binlog_background_thread_started= false;
- }
+ if (!is_relay_log)
+ stop_background_thread();
inited= 0;
close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT);