summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <mkindahl@dl145h.mysql.com>2008-03-14 18:38:54 +0100
committerunknown <mkindahl@dl145h.mysql.com>2008-03-14 18:38:54 +0100
commit92a09cf98b8f8abc6c1f1adc987c9826b657f812 (patch)
treed7ebe78e0d2c4fe12e3d1f97c09fd96acfd36b8b
parent774d21cf3bcdf40ed3c2c33662766922cbbbb569 (diff)
parent4097ee7ffa2f8eea143977a2238b016a1c99b3ca (diff)
downloadmariadb-git-92a09cf98b8f8abc6c1f1adc987c9826b657f812.tar.gz
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl sql/slave.cc: Auto merged sql/sql_repl.h: Auto merged
-rw-r--r--sql/slave.cc15
-rw-r--r--sql/sql_repl.h6
2 files changed, 14 insertions, 7 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index b333b336a25..cce139a9238 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -415,7 +415,20 @@ terminate_slave_thread(THD *thd,
while (*slave_running) // Should always be true
{
DBUG_PRINT("loop", ("killing slave thread"));
- KICK_SLAVE(thd);
+
+ pthread_mutex_lock(&thd->LOCK_delete);
+#ifndef DONT_USE_THR_ALARM
+ /*
+ Error codes from pthread_kill are:
+ EINVAL: invalid signal number (can't happen)
+ ESRCH: thread already killed (can happen, should be ignored)
+ */
+ IF_DBUG(int err= ) pthread_kill(thd->real_id, thr_client_alarm);
+ DBUG_ASSERT(err != EINVAL);
+#endif
+ thd->awake(THD::NOT_KILLED);
+ pthread_mutex_unlock(&thd->LOCK_delete);
+
/*
There is a small chance that slave thread might miss the first
alarm. To protect againts it, resend the signal until it reacts
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index cf5201f17b1..d5c9040f8dc 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -36,12 +36,6 @@ extern bool server_id_supplied;
extern int max_binlog_dump_events;
extern my_bool opt_sporadic_binlog_dump_fail;
-#define KICK_SLAVE(thd) do { \
- pthread_mutex_lock(&(thd)->LOCK_delete); \
- (thd)->awake(THD::NOT_KILLED); \
- pthread_mutex_unlock(&(thd)->LOCK_delete); \
- } while(0)
-
int start_slave(THD* thd, Master_info* mi, bool net_report);
int stop_slave(THD* thd, Master_info* mi, bool net_report);
bool change_master(THD* thd, Master_info* mi);