Commit de32e663 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-17441 - InnoDB transition to C++11 atomics

fil_space_t::redo_skipped_count transition to Atomic_counter.
parent b1c3e6c2
......@@ -621,7 +621,7 @@ fsp_space_modify_check(
case MTR_LOG_NO_REDO:
ut_ad(space->purpose == FIL_TYPE_TEMPORARY
|| space->purpose == FIL_TYPE_IMPORT
|| my_atomic_loadlint(&space->redo_skipped_count));
|| space->redo_skipped_count);
return;
case MTR_LOG_ALL:
/* We may only write redo log for a persistent tablespace. */
......
......@@ -286,8 +286,7 @@ class BtrBulk
{
#ifdef UNIV_DEBUG
if (m_flush_observer)
my_atomic_addlint(&m_index->table->space->redo_skipped_count,
1);
m_index->table->space->redo_skipped_count++;
#endif /* UNIV_DEBUG */
}
......@@ -296,8 +295,7 @@ class BtrBulk
{
#ifdef UNIV_DEBUG
if (m_flush_observer)
my_atomic_addlint(&m_index->table->space->redo_skipped_count,
ulint(-1));
m_index->table->space->redo_skipped_count--;
#endif /* UNIV_DEBUG */
}
......
......@@ -97,11 +97,9 @@ struct fil_space_t {
/** whether undo tablespace truncation is in progress */
bool is_being_truncated;
#ifdef UNIV_DEBUG
ulint redo_skipped_count;
/*!< reference count for operations who want
to skip redo log in the file space in order
to make fsp_space_modify_check pass.
Uses my_atomic_loadlint() and friends. */
/** reference count for operations who want to skip redo log in the
file space in order to make fsp_space_modify_check pass. */
Atomic_counter<ulint> redo_skipped_count;
#endif
fil_type_t purpose;/*!< purpose */
UT_LIST_BASE_NODE_T(fil_node_t) chain;
......
......@@ -677,7 +677,7 @@ mtr_t::x_lock_space(ulint space_id, const char* file, unsigned line)
ut_ad(get_log_mode() != MTR_LOG_NO_REDO
|| space->purpose == FIL_TYPE_TEMPORARY
|| space->purpose == FIL_TYPE_IMPORT
|| my_atomic_loadlint(&space->redo_skipped_count) > 0);
|| space->redo_skipped_count > 0);
}
ut_ad(space);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment