Skip to content

Commit 7d52ff5

Browse files
committed
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.
1 parent d51d2a3 commit 7d52ff5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ class CConnman
10981098
bool fAddressesInitialized{false};
10991099
AddrMan& addrman;
11001100
std::deque<std::string> m_addr_fetches GUARDED_BY(m_addr_fetches_mutex);
1101-
RecursiveMutex m_addr_fetches_mutex;
1101+
Mutex m_addr_fetches_mutex;
11021102
std::vector<std::string> m_added_nodes GUARDED_BY(m_added_nodes_mutex);
11031103
mutable RecursiveMutex m_added_nodes_mutex;
11041104
std::vector<CNode*> m_nodes GUARDED_BY(m_nodes_mutex);

0 commit comments

Comments
 (0)