summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@quad.>2008-02-18 18:12:05 +0300
committerunknown <anozdrin/alik@quad.>2008-02-18 18:12:05 +0300
commit622635b663d71fbe80e72e9620324a797e615830 (patch)
tree8bc656dc9eafa733a7b877b1a1c43886f82edc3b /sql
parentea34b5e7aa2eb78a77a619875e33dab773185ed9 (diff)
parent99933c18d2134d7e382c894e829082922067809c (diff)
downloadmariadb-git-622635b663d71fbe80e72e9620324a797e615830.tar.gz
Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged client/mysqlbinlog.cc: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/slave.cc11
-rw-r--r--sql/slave.h4
2 files changed, 8 insertions, 7 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 9dd52c60dad..ea0dde942da 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1337,14 +1337,15 @@ bool show_master_info(THD* thd, Master_info* mi)
protocol->prepare_for_resend();
/*
- TODO: we read slave_running without run_lock, whereas these variables
- are updated under run_lock and not data_lock. In 5.0 we should lock
- run_lock on top of data_lock (with good order).
+ slave_running can be accessed without run_lock but not other
+ non-volotile members like mi->io_thd, which is guarded by the mutex.
*/
+ pthread_mutex_lock(&mi->run_lock);
+ protocol->store(mi->io_thd ? mi->io_thd->proc_info : "", &my_charset_bin);
+ pthread_mutex_unlock(&mi->run_lock);
+
pthread_mutex_lock(&mi->data_lock);
pthread_mutex_lock(&mi->rli.data_lock);
-
- protocol->store(mi->io_thd ? mi->io_thd->proc_info : "", &my_charset_bin);
protocol->store(mi->host, &my_charset_bin);
protocol->store(mi->user, &my_charset_bin);
protocol->store((uint32) mi->port);
diff --git a/sql/slave.h b/sql/slave.h
index f1772bbc1fc..b4f1b7f7467 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -80,8 +80,8 @@ class Master_info;
mi->rli does not either.
In Master_info: run_lock, data_lock
- run_lock protects all information about the run state: slave_running, and the
- existence of the I/O thread (to stop/start it, you need this mutex).
+ run_lock protects all information about the run state: slave_running, thd
+ and the existence of the I/O thread to stop/start it, you need this mutex).
data_lock protects some moving members of the struct: counters (log name,
position) and relay log (MYSQL_BIN_LOG object).