summaryrefslogtreecommitdiff
path: root/sql/rpl_gtid.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-04-04 12:16:12 +0300
committerMonty <monty@mariadb.org>2018-05-07 00:07:32 +0300
commit30ebc3ee9efcab635b1f3e14b9198a58ae93c233 (patch)
tree81e3ad66cd4ec8693964317cbf23515d0e9ecf35 /sql/rpl_gtid.cc
parenta22a339f8e044a1e8df011beb0b4c8f43792ac96 (diff)
downloadmariadb-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/rpl_gtid.cc')
-rw-r--r--sql/rpl_gtid.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index d7e43a8fb39..6cd02f6ee9f 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -167,7 +167,7 @@ rpl_slave_state::check_duplicate_gtid(rpl_gtid *gtid, rpl_group_info *rgi)
break;
}
thd= rgi->thd;
- if (thd->check_killed())
+ if (unlikely(thd->check_killed()))
{
thd->send_kill_message();
res= -1;
@@ -2602,7 +2602,7 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
&stage_master_gtid_wait_primary, &old_stage);
do
{
- if (thd->check_killed())
+ if (unlikely(thd->check_killed()))
break;
else if (wait_until)
{
@@ -2654,7 +2654,7 @@ gtid_waiting::wait_for_gtid(THD *thd, rpl_gtid *wait_gtid,
&stage_master_gtid_wait, &old_stage);
did_enter_cond= true;
}
- while (!elem.done && !thd->check_killed())
+ while (!elem.done && likely(!thd->check_killed()))
{
thd_wait_begin(thd, THD_WAIT_BINLOG);
if (wait_until)