1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MWL#116: Code simplifications for TC_LOG_MMAP.

Make TC_LOG_MMAP (and TC_LOG_DUMMY) derive directly from TC_LOG, avoiding the
inheritance hierarchy TC_LOG_queued->TC_LOG_unordered.

Put the wakeup facility for commit_ordered() calls into the THD class.

Some renaming to get better names.
This commit is contained in:
unknown
2010-10-28 12:40:42 +02:00
parent b357fca4de
commit b91ad17cea
4 changed files with 119 additions and 103 deletions

View File

@ -704,8 +704,8 @@ THD::THD()
active_vio = 0;
#endif
pthread_mutex_init(&LOCK_thd_data, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&LOCK_commit_ordered, MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_commit_ordered, 0);
pthread_mutex_init(&LOCK_wakeup_ready, MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_wakeup_ready, 0);
/* Variables with default values */
proc_info="login";
@ -1037,8 +1037,8 @@ THD::~THD()
free_root(&transaction.mem_root,MYF(0));
#endif
mysys_var=0; // Safety (shouldn't be needed)
pthread_cond_destroy(&COND_commit_ordered);
pthread_mutex_destroy(&LOCK_commit_ordered);
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;
@ -4009,6 +4009,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_cond_signal(&COND_wakeup_ready);
pthread_mutex_unlock(&LOCK_wakeup_ready);
}
bool Discrete_intervals_list::append(ulonglong start, ulonglong val,
ulonglong incr)
{