1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00

Expanded comment on TryGetValues thread safety in GetConnection

This commit is contained in:
lidgren
2012-05-26 08:53:54 +00:00
parent 0fadd32a74
commit 5859971a7e

View File

@@ -150,7 +150,11 @@ namespace Lidgren.Network
public NetConnection GetConnection(IPEndPoint ep)
{
NetConnection retval;
m_connectionLookup.TryGetValue(ep, out retval); // this should not pose a threading problem, afaict
// this should not pose a threading problem, m_connectionLookup is never added to concurrently
// and TryGetValue will not throw an exception on fail, only yield null, which is acceptable
m_connectionLookup.TryGetValue(ep, out retval);
return retval;
}