mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
refactor: replace RecursiveMutex m_added_nodes_mutex with Mutex
The RecursiveMutex m_added_nodes_mutex is used at three places: - CConnman::GetAddedNodeInfo() - CConnman::AddNode() - CConnman::ThreadOpenConnections() In each of the critical sections, only the the m_added_nodes member is accessed (and in the last case, also m_addr_fetches), without any chance that within one section another one is called. Hence, we can use an ordinary Mutex instead of RecursiveMutex.
This commit is contained in:
parent
7d52ff5c38
commit
3726a45958
@ -1100,7 +1100,7 @@ private:
|
|||||||
std::deque<std::string> m_addr_fetches GUARDED_BY(m_addr_fetches_mutex);
|
std::deque<std::string> m_addr_fetches GUARDED_BY(m_addr_fetches_mutex);
|
||||||
Mutex m_addr_fetches_mutex;
|
Mutex m_addr_fetches_mutex;
|
||||||
std::vector<std::string> m_added_nodes GUARDED_BY(m_added_nodes_mutex);
|
std::vector<std::string> m_added_nodes GUARDED_BY(m_added_nodes_mutex);
|
||||||
mutable RecursiveMutex m_added_nodes_mutex;
|
mutable Mutex m_added_nodes_mutex;
|
||||||
std::vector<CNode*> m_nodes GUARDED_BY(m_nodes_mutex);
|
std::vector<CNode*> m_nodes GUARDED_BY(m_nodes_mutex);
|
||||||
std::list<CNode*> m_nodes_disconnected;
|
std::list<CNode*> m_nodes_disconnected;
|
||||||
mutable RecursiveMutex m_nodes_mutex;
|
mutable RecursiveMutex m_nodes_mutex;
|
||||||
|
Loading…
Reference in New Issue
Block a user