1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-23 16:08:51 -05:00

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

View File

@ -1053,7 +1053,11 @@ protected:
void PrintInfo(std::ostream &out); void PrintInfo(std::ostream &out);
void PrintInfo(); 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; UDPSocket m_udpSocket;
MutexedQueue<ConnectionCommand> m_command_queue; MutexedQueue<ConnectionCommand> m_command_queue;