mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
refactor: Add more negative !m_banned_mutex
thread safety annotations
Could be verified with $ ./configure CC=clang CXX=clang++ CXXFLAGS='-Wthread-safety -Wthread-safety-negative' $ make clean $ make 2>&1 | grep m_banned_mutex
This commit is contained in:
parent
0fb2908708
commit
37d150d8c5
1 changed files with 11 additions and 11 deletions
22
src/banman.h
22
src/banman.h
|
@ -60,24 +60,24 @@ class BanMan
|
||||||
public:
|
public:
|
||||||
~BanMan();
|
~BanMan();
|
||||||
BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time);
|
BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time);
|
||||||
void Ban(const CNetAddr& net_addr, int64_t ban_time_offset = 0, bool since_unix_epoch = false);
|
void Ban(const CNetAddr& net_addr, int64_t ban_time_offset = 0, bool since_unix_epoch = false) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
void Ban(const CSubNet& sub_net, int64_t ban_time_offset = 0, bool since_unix_epoch = false);
|
void Ban(const CSubNet& sub_net, int64_t ban_time_offset = 0, bool since_unix_epoch = false) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
void Discourage(const CNetAddr& net_addr);
|
void Discourage(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
void ClearBanned();
|
void ClearBanned() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
|
|
||||||
//! Return whether net_addr is banned
|
//! Return whether net_addr is banned
|
||||||
bool IsBanned(const CNetAddr& net_addr);
|
bool IsBanned(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
|
|
||||||
//! Return whether sub_net is exactly banned
|
//! Return whether sub_net is exactly banned
|
||||||
bool IsBanned(const CSubNet& sub_net);
|
bool IsBanned(const CSubNet& sub_net) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
|
|
||||||
//! Return whether net_addr is discouraged.
|
//! Return whether net_addr is discouraged.
|
||||||
bool IsDiscouraged(const CNetAddr& net_addr);
|
bool IsDiscouraged(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
|
|
||||||
bool Unban(const CNetAddr& net_addr);
|
bool Unban(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
bool Unban(const CSubNet& sub_net);
|
bool Unban(const CSubNet& sub_net) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
void GetBanned(banmap_t& banmap);
|
void GetBanned(banmap_t& banmap) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
void DumpBanlist();
|
void DumpBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
void LoadBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
|
||||||
|
|
Loading…
Add table
Reference in a new issue