summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2018-10-25 19:13:05 +0400
committerSergey Vojtovich <svoj@mariadb.org>2018-12-27 22:46:38 +0400
commitdbd40edfe680ebaea529b97c3dafa20cb1f40f4e (patch)
tree6a408fae2c4a4bf6ad6cb45cd44dc9cb598bc9c5
parent66ec8adb77856d5fa6b77edf3ee8471576c30938 (diff)
downloadmariadb-git-dbd40edfe680ebaea529b97c3dafa20cb1f40f4e.tar.gz
MDEV-17441 - InnoDB transition to C++11 atomics
ibuf_t::n_merges transition to Atomic_counter.
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc4
-rw-r--r--storage/innobase/include/ibuf0ibuf.ic3
2 files changed, 4 insertions, 3 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index ff7081ffc2a..1acfa987ff1 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -4760,7 +4760,7 @@ reset_bit:
btr_pcur_close(&pcur);
mem_heap_free(heap);
- my_atomic_addlint(&ibuf->n_merges, 1);
+ ibuf->n_merges++;
ibuf_add_ops(ibuf->n_merged_ops, mops);
ibuf_add_ops(ibuf->n_discarded_ops, dops);
@@ -4897,7 +4897,7 @@ ibuf_print(
ibuf->size,
ibuf->free_list_len,
ibuf->seg_size,
- ibuf->n_merges);
+ ulint{ibuf->n_merges});
fputs("merged operations:\n ", file);
ibuf_print_ops(ibuf->n_merged_ops, file);
diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic
index f6ff6f2a7fd..bb8cfcc9fdd 100644
--- a/storage/innobase/include/ibuf0ibuf.ic
+++ b/storage/innobase/include/ibuf0ibuf.ic
@@ -78,7 +78,8 @@ struct ibuf_t{
ulint height; /*!< tree height */
dict_index_t* index; /*!< insert buffer index */
- ulint n_merges; /*!< number of pages merged */
+ /** number of pages merged */
+ Atomic_counter<ulint> n_merges;
ulint n_merged_ops[IBUF_OP_COUNT];
/*!< number of operations of each type
merged to index pages */