From 7097add83c8596f81be9edd66971ffd2486357eb Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 2 Feb 2021 10:18:39 +0800 Subject: refactor: replace Boost shared_mutex with std shared_mutex in sigcache Co-authored-by: MarcoFalke falke.marco@gmail.com Co-authored-by: sinetek pitwuu@gmail.com --- src/script/sigcache.cpp | 12 +++++++----- test/lint/lint-includes.sh | 2 -- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index cf47d37e70..c6d898a25a 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -12,8 +12,10 @@ #include -#include -#include +#include +#include +#include +#include namespace { /** @@ -29,7 +31,7 @@ private: CSHA256 m_salted_hasher_schnorr; typedef CuckooCache::cache map_type; map_type setValid; - boost::shared_mutex cs_sigcache; + std::shared_mutex cs_sigcache; public: CSignatureCache() @@ -64,13 +66,13 @@ public: bool Get(const uint256& entry, const bool erase) { - boost::shared_lock lock(cs_sigcache); + std::shared_lock lock(cs_sigcache); return setValid.contains(entry, erase); } void Set(const uint256& entry) { - boost::unique_lock lock(cs_sigcache); + std::unique_lock lock(cs_sigcache); setValid.insert(entry); } uint32_t setup_bytes(size_t n) diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index 6623f9ce4c..a3c8f33e79 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -67,8 +67,6 @@ EXPECTED_BOOST_INCLUDES=( boost/signals2/optional_last_value.hpp boost/signals2/signal.hpp boost/test/unit_test.hpp - boost/thread/lock_types.hpp - boost/thread/shared_mutex.hpp ) for BOOST_INCLUDE in $(git grep '^#include ' | sort -u); do -- cgit v1.2.3