diff options
author | Monty <monty@mariadb.org> | 2018-04-04 12:16:12 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-05-07 00:07:32 +0300 |
commit | 30ebc3ee9efcab635b1f3e14b9198a58ae93c233 (patch) | |
tree | 81e3ad66cd4ec8693964317cbf23515d0e9ecf35 /sql/semisync_master.cc | |
parent | a22a339f8e044a1e8df011beb0b4c8f43792ac96 (diff) | |
download | mariadb-git-30ebc3ee9efcab635b1f3e14b9198a58ae93c233.tar.gz |
Add likely/unlikely to speed up execution
Added to:
- if (error)
- Lex
- sql_yacc.yy and sql_yacc_ora.yy
- In header files to alloc() calls
- Added thd argument to thd_net_is_killed()
Diffstat (limited to 'sql/semisync_master.cc')
-rw-r--r-- | sql/semisync_master.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/semisync_master.cc b/sql/semisync_master.cc index 3c88bdddad4..8a82fd9085c 100644 --- a/sql/semisync_master.cc +++ b/sql/semisync_master.cc @@ -779,7 +779,6 @@ void Repl_semi_sync_master::dump_end(THD* thd) int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, my_off_t trx_wait_binlog_pos) { - DBUG_ENTER("Repl_semi_sync_master::commit_trx"); if (get_master_enabled() && trx_wait_binlog_name) @@ -788,15 +787,16 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, struct timespec abstime; int wait_result; PSI_stage_info old_stage; + THD *thd= current_thd; set_timespec(start_ts, 0); - DEBUG_SYNC(current_thd, "rpl_semisync_master_commit_trx_before_lock"); + DEBUG_SYNC(thd, "rpl_semisync_master_commit_trx_before_lock"); /* Acquire the mutex. */ lock(); /* This must be called after acquired the lock */ - THD_ENTER_COND(NULL, &COND_binlog_send, &LOCK_binlog, + THD_ENTER_COND(thd, &COND_binlog_send, &LOCK_binlog, & stage_waiting_for_semi_sync_ack_from_slave, & old_stage); @@ -809,7 +809,7 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, trx_wait_binlog_name, (ulong)trx_wait_binlog_pos, (int)is_on())); - while (is_on() && !thd_killed(current_thd)) + while (is_on() && !thd_killed(thd)) { if (m_reply_file_name_inited) { @@ -924,7 +924,7 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, m_active_tranxs may be NULL if someone disabled semi sync during cond_timewait() */ - assert(thd_killed(current_thd) || !m_active_tranxs || + assert(thd_killed(thd) || !m_active_tranxs || !m_active_tranxs->is_tranx_end_pos(trx_wait_binlog_name, trx_wait_binlog_pos)); @@ -937,7 +937,7 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, /* The lock held will be released by thd_exit_cond, so no need to call unlock() here */ - THD_EXIT_COND(NULL, & old_stage); + THD_EXIT_COND(thd, &old_stage); } DBUG_RETURN(0); |