summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/log.cc14
-rw-r--r--sql/log.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 6ec186b3786..85f47d3edf9 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -5928,11 +5928,21 @@ int TC_LOG_unordered::log_and_order(THD *thd, my_xid xid, bool all,
TC_LOG_group_commit::TC_LOG_group_commit()
: num_commits(0), num_group_commits(0)
{
+}
+
+TC_LOG_group_commit::~TC_LOG_group_commit()
+{
+}
+
+void
+TC_LOG_group_commit::init()
+{
my_pthread_mutex_init(&LOCK_group_commit, MY_MUTEX_INIT_SLOW,
"LOCK_group_commit", MYF(0));
}
-TC_LOG_group_commit::~TC_LOG_group_commit()
+void
+TC_LOG_group_commit::deinit()
{
pthread_mutex_destroy(&LOCK_group_commit);
}
@@ -6591,6 +6601,7 @@ int TC_LOG_BINLOG::open(const char *opt_name)
DBUG_ASSERT(total_ha_2pc > 1);
DBUG_ASSERT(opt_name && opt_name[0]);
+ TC_LOG_group_commit::init();
pthread_mutex_init(&LOCK_prep_xids, MY_MUTEX_INIT_FAST);
pthread_cond_init (&COND_prep_xids, 0);
@@ -6674,6 +6685,7 @@ void TC_LOG_BINLOG::close()
DBUG_ASSERT(prepared_xids==0);
pthread_mutex_destroy(&LOCK_prep_xids);
pthread_cond_destroy (&COND_prep_xids);
+ TC_LOG_group_commit::deinit();
}
/*
diff --git a/sql/log.h b/sql/log.h
index 7a6b7f070b5..f43ae433c8a 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -150,6 +150,8 @@ class TC_LOG_group_commit: public TC_LOG_queued
public:
TC_LOG_group_commit();
~TC_LOG_group_commit();
+ void init();
+ void deinit();
int log_and_order(THD *thd, my_xid xid, bool all,
bool need_prepare_ordered, bool need_commit_ordered);