diff options
author | unknown <knielsen@knielsen-hq.org> | 2011-04-08 09:39:33 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2011-04-08 09:39:33 +0200 |
commit | 64e43e1cc88c66bd89f95a5307020bcf60ba4b96 (patch) | |
tree | 1ae6299d5a75f92fa97b240b0670c81c9a301afe /sql/sql_class.cc | |
parent | 8b427b7d5548aeb214c70b004cc9056b9f7a6f7c (diff) | |
parent | 86008e0ca2b864f1ab7a30e496d7c67c8fce06c2 (diff) | |
download | mariadb-git-64e43e1cc88c66bd89f95a5307020bcf60ba4b96.tar.gz |
Merge various replication-related patches into MariaDB 5.3:
- MWL#116 Group commit
- MWL#136 Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT
- MWL#47 Annotate_rows_log_event
- MWL#163 innodb_release_locks_early
- Percona patch enhancing row-based replication for tables with no primary key
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f10655c3e51..f8905cd5f8c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -763,6 +763,8 @@ THD::THD() active_vio = 0; #endif pthread_mutex_init(&LOCK_thd_data, MY_MUTEX_INIT_FAST); + pthread_mutex_init(&LOCK_wakeup_ready, MY_MUTEX_INIT_FAST); + pthread_cond_init(&COND_wakeup_ready, 0); /* Variables with default values */ proc_info="login"; @@ -1149,6 +1151,8 @@ THD::~THD() free_root(&transaction.mem_root,MYF(0)); #endif mysys_var=0; // Safety (shouldn't be needed) + pthread_cond_destroy(&COND_wakeup_ready); + pthread_mutex_destroy(&LOCK_wakeup_ready); pthread_mutex_destroy(&LOCK_thd_data); #ifndef DBUG_OFF dbug_sentry= THD_SENTRY_GONE; @@ -4243,6 +4247,25 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, DBUG_RETURN(0); } +void +THD::wait_for_wakeup_ready() +{ + pthread_mutex_lock(&LOCK_wakeup_ready); + while (!wakeup_ready) + pthread_cond_wait(&COND_wakeup_ready, &LOCK_wakeup_ready); + pthread_mutex_unlock(&LOCK_wakeup_ready); +} + +void +THD::signal_wakeup_ready() +{ + pthread_mutex_lock(&LOCK_wakeup_ready); + wakeup_ready= true; + pthread_mutex_unlock(&LOCK_wakeup_ready); + pthread_cond_signal(&COND_wakeup_ready); +} + + bool Discrete_intervals_list::append(ulonglong start, ulonglong val, ulonglong incr) { |