From 79e2647556773d46cc0299e73ca23c41a153ff2a Mon Sep 17 00:00:00 2001 From: Břetislav Štec Date: Sat, 1 Aug 2015 13:53:15 +0200 Subject: src/network/connection.h: Fix race condition --- src/network/connection.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/connection.h b/src/network/connection.h index b1f9e70a8..c48da2c70 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -1053,7 +1053,11 @@ protected: void PrintInfo(std::ostream &out); void PrintInfo(); - std::list getPeerIDs() { return m_peer_ids; } + std::list getPeerIDs() + { + JMutexAutoLock peerlock(m_peers_mutex); + return m_peer_ids; + } UDPSocket m_udpSocket; MutexedQueue m_command_queue; -- cgit v1.2.3