From 7d52ff5c389643cde613d86fee33d7087f47b8b4 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sat, 28 Aug 2021 19:59:41 +0200 Subject: 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. --- src/net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/net.h b/src/net.h index a10b055a97..93d36a6e3d 100644 --- a/src/net.h +++ b/src/net.h @@ -1098,7 +1098,7 @@ private: bool fAddressesInitialized{false}; AddrMan& addrman; std::deque m_addr_fetches GUARDED_BY(m_addr_fetches_mutex); - RecursiveMutex m_addr_fetches_mutex; + Mutex m_addr_fetches_mutex; std::vector m_added_nodes GUARDED_BY(m_added_nodes_mutex); mutable RecursiveMutex m_added_nodes_mutex; std::vector m_nodes GUARDED_BY(m_nodes_mutex); -- cgit v1.2.3