1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 23:26:32 +09:00

Fix data race in NetPeerStatistics.BytesInRecyclePool

This commit is contained in:
Marius Ungureanu
2015-09-05 10:52:23 +03:00
parent 0f9ca1d106
commit 2d1f9a4b91

View File

@@ -105,7 +105,14 @@ namespace Lidgren.Network
/// <summary>
/// Gets the number of bytes in the recycled pool
/// </summary>
public int BytesInRecyclePool { get { return m_peer.m_storagePoolBytes; } }
public int BytesInRecyclePool
{
get
{
lock (m_peer.m_storagePool)
return m_peer.m_storagePoolBytes;
}
}
#if !USE_RELEASE_STATISTICS
[Conditional("DEBUG")]