summaryrefslogtreecommitdiff
path: root/sql/rpl_gtid.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2020-03-21 15:52:24 +0400
committerSergey Vojtovich <svoj@mariadb.org>2020-03-21 15:55:00 +0400
commit4d9977e5ff9843e132fda480536192caaf69aba2 (patch)
tree0725d607698bea3b6f34b846918ccb1e57822827 /sql/rpl_gtid.cc
parent9394cc89143e4fce3126a96ac1c8a91a66d71dea (diff)
downloadmariadb-git-4d9977e5ff9843e132fda480536192caaf69aba2.tar.gz
default_gtid_pos_table: my_atomic to std::atomic
Diffstat (limited to 'sql/rpl_gtid.cc')
-rw-r--r--sql/rpl_gtid.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 5681f8652a4..8f9fdcaffde 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -497,7 +497,7 @@ gtid_check_rpl_slave_state_table(TABLE *table)
void
rpl_slave_state::select_gtid_pos_table(THD *thd, LEX_CSTRING *out_tablename)
{
- struct gtid_pos_table *list, *table_entry, *default_entry;
+ struct gtid_pos_table *list, *table_entry;
/*
See comments on rpl_slave_state::gtid_pos_tables for rules around proper
@@ -565,9 +565,8 @@ rpl_slave_state::select_gtid_pos_table(THD *thd, LEX_CSTRING *out_tablename)
already active in the transaction, or if there is no current transaction
engines available, we return the default gtid_slave_pos table.
*/
- default_entry= (struct gtid_pos_table *)
- my_atomic_loadptr_explicit(&default_gtid_pos_table, MY_MEMORY_ORDER_ACQUIRE);
- *out_tablename= default_entry->table_name;
+ *out_tablename=
+ default_gtid_pos_table.load(std::memory_order_acquire)->table_name;
/* Record in status that we failed to find a suitable gtid_pos table. */
if (count > 0)
{
@@ -840,9 +839,7 @@ rpl_slave_state::select_gtid_pos_table(void *hton)
table_entry= table_entry->next;
}
- table_entry= (struct gtid_pos_table *)
- my_atomic_loadptr_explicit(&default_gtid_pos_table, MY_MEMORY_ORDER_ACQUIRE);
- return &table_entry->table_name;
+ return &default_gtid_pos_table.load(std::memory_order_acquire)->table_name;
}
@@ -1445,8 +1442,7 @@ rpl_slave_state::set_gtid_pos_tables_list(rpl_slave_state::gtid_pos_table *new_l
mysql_mutex_assert_owner(&LOCK_slave_state);
old_list= (struct gtid_pos_table *)gtid_pos_tables;
my_atomic_storeptr_explicit(&gtid_pos_tables, new_list, MY_MEMORY_ORDER_RELEASE);
- my_atomic_storeptr_explicit(&default_gtid_pos_table, default_entry,
- MY_MEMORY_ORDER_RELEASE);
+ default_gtid_pos_table.store(default_entry, std::memory_order_release);
free_gtid_pos_tables(old_list);
}