Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
src/network/connection.h: Fix race condition
  • Loading branch information
t0suj4 authored and est31 committed Aug 1, 2015
1 parent c39a85a commit 79e2647
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/network/connection.h
Expand Up @@ -1053,7 +1053,11 @@ class Connection
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;
Expand Down

0 comments on commit 79e2647

Please sign in to comment.