summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-05-23 10:20:57 +0200
committerunknown <msvensson@neptunus.(none)>2006-05-23 10:20:57 +0200
commit4d3a78a26b44e5faa5a02c42398e2884dee80524 (patch)
tree591155137f3ffe8fee8d490e8fb086899dd79e35 /sql/slave.cc
parent48fe5a2d8feef07b50d8cda323bff706e90ce1c0 (diff)
downloadmariadb-git-4d3a78a26b44e5faa5a02c42398e2884dee80524.tar.gz
Bug#19938 Valgrind error (race) in handle_slave_sql()
- Unlock the mutex after looking at rli->events_till_abort - Already fixed in 5.1 so it will be null merged. sql/slave.cc: Unlock the mutex after looking at rli->events_till_abort
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index fa7ccc4427d..399a36ed077 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3950,11 +3950,20 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
pthread_mutex_unlock(&LOCK_thread_count);
pthread_cond_broadcast(&rli->stop_cond);
// tell the world we are done
- pthread_mutex_unlock(&rli->run_lock);
+
#ifndef DBUG_OFF // TODO: reconsider the code below
if (abort_slave_event_count && !rli->events_till_abort)
+ {
+ /*
+ Bug #19938 Valgrind error (race) in handle_slave_sql()
+ Read the value of rli->event_till_abort before releasing the mutex
+ */
+ pthread_mutex_unlock(&rli->run_lock);
goto slave_begin;
-#endif
+ }
+#endif
+ pthread_mutex_unlock(&rli->run_lock);
+
my_thread_end();
pthread_exit(0);
DBUG_RETURN(0); // Can't return anything here