summaryrefslogtreecommitdiff
path: root/sql/rpl_reporting.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/rpl_reporting.h')
-rw-r--r--sql/rpl_reporting.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/rpl_reporting.h b/sql/rpl_reporting.h
index 2e3fa3cea83..ce33407e516 100644
--- a/sql/rpl_reporting.h
+++ b/sql/rpl_reporting.h
@@ -16,6 +16,8 @@
class Slave_reporting_capability
{
public:
+ /** lock used to synchronize m_last_error on 'SHOW SLAVE STATUS' **/
+ mutable pthread_mutex_t err_lock;
/**
Constructor.
@@ -24,6 +26,7 @@ public:
Slave_reporting_capability(char const *thread_name)
: m_thread_name(thread_name)
{
+ pthread_mutex_init(&err_lock, MY_MUTEX_INIT_FAST);
}
/**
@@ -44,7 +47,9 @@ public:
STATUS</code>.
*/
void clear_error() {
+ pthread_mutex_lock(&err_lock);
m_last_error.clear();
+ pthread_mutex_unlock(&err_lock);
}
/**
@@ -72,6 +77,7 @@ public:
Error const& last_error() const { return m_last_error; }
+ virtual ~Slave_reporting_capability()= 0;
private:
/**
Last error produced by the I/O or SQL thread respectively.
@@ -79,6 +85,10 @@ private:
mutable Error m_last_error;
char const *const m_thread_name;
+
+ // not implemented
+ Slave_reporting_capability(const Slave_reporting_capability& rhs);
+ Slave_reporting_capability& operator=(const Slave_reporting_capability& rhs);
};
#endif // RPL_REPORTING_H