From d58dc9f94365ba3f993594bab293915d79dbe117 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 29 Aug 2018 22:33:33 +0200 Subject: Add lock annotations (cs_args) --- src/util.cpp | 4 ++-- src/util.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/util.cpp b/src/util.cpp index ef5ea32ed1..e58ff042e8 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -216,7 +216,7 @@ public: /** Determine whether to use config settings in the default section, * See also comments around ArgsManager::ArgsManager() below. */ - static inline bool UseDefaultSection(const ArgsManager& am, const std::string& arg) + static inline bool UseDefaultSection(const ArgsManager& am, const std::string& arg) EXCLUSIVE_LOCKS_REQUIRED(am.cs_args) { return (am.m_network == CBaseChainParams::MAIN || am.m_network_only_args.count(arg) == 0); } @@ -295,7 +295,7 @@ public: /* Special test for -testnet and -regtest args, because we * don't want to be confused by craziness like "[regtest] testnet=1" */ - static inline bool GetNetBoolArg(const ArgsManager &am, const std::string& net_arg) + static inline bool GetNetBoolArg(const ArgsManager &am, const std::string& net_arg) EXCLUSIVE_LOCKS_REQUIRED(am.cs_args) { std::pair found_result(false,std::string()); found_result = GetArgHelper(am.m_override_args, net_arg, true); diff --git a/src/util.h b/src/util.h index e27e73089e..7bf9fdbe12 100644 --- a/src/util.h +++ b/src/util.h @@ -142,11 +142,11 @@ protected: }; mutable CCriticalSection cs_args; - std::map> m_override_args; - std::map> m_config_args; - std::string m_network; - std::set m_network_only_args; - std::map> m_available_args; + std::map> m_override_args GUARDED_BY(cs_args); + std::map> m_config_args GUARDED_BY(cs_args); + std::string m_network GUARDED_BY(cs_args); + std::set m_network_only_args GUARDED_BY(cs_args); + std::map> m_available_args GUARDED_BY(cs_args); bool ReadConfigStream(std::istream& stream, std::string& error, bool ignore_invalid_keys = false); -- cgit v1.2.3