diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 3347de11ff..907f2bbc50 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -254,7 +254,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP void packet_type_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { for (int i = 0; i < 9; ++i) - m_log.WarnFormat("OutgoingPacket type {0} count = {1}", i, OutgoingPacket.CatCounts[i]); + { + int val = Interlocked.Exchange(ref OutgoingPacket.CatCounts[i], 0); + m_log.WarnFormat("OutgoingPacket type {0} count = {1}", i, val); + } } public new void Stop() diff --git a/OpenSim/Region/ClientStack/LindenUDP/OutgoingPacket.cs b/OpenSim/Region/ClientStack/LindenUDP/OutgoingPacket.cs index 90a2e8eaf3..7d780dfd8d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/OutgoingPacket.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/OutgoingPacket.cs @@ -27,7 +27,8 @@ using System; using OpenSim.Framework; -using OpenMetaverse; +using OpenMetaverse; +using System.Threading; namespace OpenSim.Region.ClientStack.LindenUDP { @@ -67,10 +68,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP Client = client; Buffer = buffer; Category = category; + int type = (int)category; if (category == ThrottleOutPacketType.Unknown) - CatCounts[8]++; - else - CatCounts[(int)category]++; + type = 8; + Interlocked.Increment(ref OutgoingPacket.CatCounts[type]); } } }