src/network/connection.h: Fix race condition

This commit is contained in:
Břetislav Štec 2015-08-01 13:53:15 +02:00 committed by est31
parent c39a85a88d
commit 79e2647556

@ -1053,7 +1053,11 @@ protected:
void PrintInfo(std::ostream &out);
void PrintInfo();
std::list<u16> getPeerIDs() { return m_peer_ids; }
std::list<u16> getPeerIDs()
{
JMutexAutoLock peerlock(m_peers_mutex);
return m_peer_ids;
}
UDPSocket m_udpSocket;
MutexedQueue<ConnectionCommand> m_command_queue;