summaryrefslogtreecommitdiff
path: root/include/my_counter.h
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2018-12-28 18:51:13 +0400
committerSergey Vojtovich <svoj@mariadb.org>2018-12-29 14:09:15 +0400
commitd2bdd789150691533698d3949041d867aa9b3bd6 (patch)
tree90b58c5ad431a10a38875749c9c2eccf84ffb601 /include/my_counter.h
parent656a702ca9318c58fde97e19ba7b242d11c05c56 (diff)
downloadmariadb-git-d2bdd789150691533698d3949041d867aa9b3bd6.tar.gz
Master_info counters transition to Atomic_counter
Diffstat (limited to 'include/my_counter.h')
-rw-r--r--include/my_counter.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/my_counter.h b/include/my_counter.h
index 00fbf8cef91..68c04fb3f1d 100644
--- a/include/my_counter.h
+++ b/include/my_counter.h
@@ -28,6 +28,9 @@ template <typename Type> class Atomic_counter
Type sub(Type i) { return m_counter.fetch_sub(i, std::memory_order_relaxed); }
public:
+ Atomic_counter(Type val): m_counter(val) {}
+ Atomic_counter() {}
+
Type operator++(int) { return add(1); }
Type operator--(int) { return sub(1); }