Skip to content

Commit 79e2647

Browse files
t0suj4est31
authored andcommittedAug 1, 2015
src/network/connection.h: Fix race condition
1 parent c39a85a commit 79e2647

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/network/connection.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,11 @@ class Connection
10531053
void PrintInfo(std::ostream &out);
10541054
void PrintInfo();
10551055

1056-
std::list<u16> getPeerIDs() { return m_peer_ids; }
1056+
std::list<u16> getPeerIDs()
1057+
{
1058+
JMutexAutoLock peerlock(m_peers_mutex);
1059+
return m_peer_ids;
1060+
}
10571061

10581062
UDPSocket m_udpSocket;
10591063
MutexedQueue<ConnectionCommand> m_command_queue;

0 commit comments

Comments
 (0)
Please sign in to comment.