diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-08-28 19:59:41 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-11-24 19:34:26 +0100 |
commit | 7d52ff5c389643cde613d86fee33d7087f47b8b4 (patch) | |
tree | 2acf44d95f919d267f7b1bba38648c4d60a60630 | |
parent | d51d2a3bb5b0011efa1b4f1e2c9512a16ce9b347 (diff) |
refactor: replace RecursiveMutex m_addr_fetches_mutex with Mutex
The RecursiveMutex m_addr_fetches_mutex is used at three places:
- CConnman::AddAddrFetch()
- CConnman::ProcessAddrFetch()
- CConnman::ThreadOpenConnections()
In each of the critical sections, only the the m_addr_fetches is accessed
(and in the last case, also vAddedNodes), without any chance that within
one section another one is called. Hence, we can use an ordinary Mutex
instead of RecursiveMutex.
-rw-r--r-- | src/net.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1098,7 +1098,7 @@ private: bool fAddressesInitialized{false}; AddrMan& addrman; std::deque<std::string> m_addr_fetches GUARDED_BY(m_addr_fetches_mutex); - RecursiveMutex m_addr_fetches_mutex; + Mutex m_addr_fetches_mutex; std::vector<std::string> m_added_nodes GUARDED_BY(m_added_nodes_mutex); mutable RecursiveMutex m_added_nodes_mutex; std::vector<CNode*> m_nodes GUARDED_BY(m_nodes_mutex); |