diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2018-12-29 01:46:56 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2018-12-29 14:19:08 +0400 |
commit | 3bdd93c10ae8601fa74da9de01b406d2901bfcfc (patch) | |
tree | 056b335c123b6004521bd6042a18b1533e755be0 /sql/table_cache.cc | |
parent | 0f034e2e9661733a9662ac91318b7f02efa0c1a3 (diff) | |
download | mariadb-git-3bdd93c10ae8601fa74da9de01b406d2901bfcfc.tar.gz |
tc_contention_warning_reported transition to std::atomic
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r-- | sql/table_cache.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 980dd2e4672..7a555d53558 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -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. */ @@ -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 " |