Skip to content

Commit

Permalink
tc_contention_warning_reported transition to std::atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Vojtovich committed Dec 29, 2018
1 parent 0f034e2 commit 3bdd93c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sql/table_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ulong tdc_size; /**< Table definition cache threshold for LRU eviction. */
ulong tc_size; /**< Table cache threshold for LRU eviction. */
uint32 tc_instances;
uint32 tc_active_instances= 1;
static uint32 tc_contention_warning_reported;
static std::atomic<bool> tc_contention_warning_reported;

/** Data collections. */
static LF_HASH tdc_hash; /**< Collection of TABLE_SHARE objects. */
Expand Down Expand Up @@ -187,8 +187,8 @@ struct Table_cache_instance
n_instances + 1);
}
}
else if (!my_atomic_fas32_explicit((int32*) &tc_contention_warning_reported,
1, MY_MEMORY_ORDER_RELAXED))
else if (!tc_contention_warning_reported.exchange(true,
std::memory_order_relaxed))
{
sql_print_warning("Detected table cache mutex contention at instance %d: "
"%d%% waits. Additional table cache instance "
Expand Down

0 comments on commit 3bdd93c

Please sign in to comment.