Skip to content

Commit dbd40ed

Browse files
committed
MDEV-17441 - InnoDB transition to C++11 atomics
ibuf_t::n_merges transition to Atomic_counter.
1 parent 66ec8ad commit dbd40ed

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

storage/innobase/ibuf/ibuf0ibuf.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4760,7 +4760,7 @@ ibuf_merge_or_delete_for_page(
47604760
btr_pcur_close(&pcur);
47614761
mem_heap_free(heap);
47624762

4763-
my_atomic_addlint(&ibuf->n_merges, 1);
4763+
ibuf->n_merges++;
47644764
ibuf_add_ops(ibuf->n_merged_ops, mops);
47654765
ibuf_add_ops(ibuf->n_discarded_ops, dops);
47664766

@@ -4897,7 +4897,7 @@ ibuf_print(
48974897
ibuf->size,
48984898
ibuf->free_list_len,
48994899
ibuf->seg_size,
4900-
ibuf->n_merges);
4900+
ulint{ibuf->n_merges});
49014901

49024902
fputs("merged operations:\n ", file);
49034903
ibuf_print_ops(ibuf->n_merged_ops, file);

storage/innobase/include/ibuf0ibuf.ic

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ struct ibuf_t{
7878
ulint height; /*!< tree height */
7979
dict_index_t* index; /*!< insert buffer index */
8080

81-
ulint n_merges; /*!< number of pages merged */
81+
/** number of pages merged */
82+
Atomic_counter<ulint> n_merges;
8283
ulint n_merged_ops[IBUF_OP_COUNT];
8384
/*!< number of operations of each type
8485
merged to index pages */

0 commit comments

Comments
 (0)