diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index 0a090b4..71f4c47 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | |||
@@ -535,14 +535,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
535 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; | 535 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; |
536 | QueueEmpty callback = OnQueueEmpty; | 536 | QueueEmpty callback = OnQueueEmpty; |
537 | 537 | ||
538 | int start = Environment.TickCount; | ||
539 | |||
538 | if (callback != null) | 540 | if (callback != null) |
539 | { | 541 | { |
540 | try { callback(type); } | 542 | try { callback(type); } |
541 | catch (Exception e) { m_log.Error("[LLUDPCLIENT]: OnQueueEmpty(" + type + ") threw an exception: " + e.Message, e); } | 543 | catch (Exception e) { m_log.Error("[LLUDPCLIENT]: OnQueueEmpty(" + type + ") threw an exception: " + e.Message, e); } |
542 | } | 544 | } |
543 | 545 | ||
544 | // HACK: Try spending some extra time here to slow down OnQueueEmpty calls | 546 | // Make sure all queue empty calls take at least a measurable amount of time, |
545 | //System.Threading.Thread.Sleep(100); | 547 | // otherwise we'll peg a CPU trying to fire these too fast |
548 | if (Environment.TickCount == start) | ||
549 | System.Threading.Thread.Sleep((int)m_udpServer.TickCountResolution); | ||
546 | 550 | ||
547 | m_onQueueEmptyRunning[i] = false; | 551 | m_onQueueEmptyRunning[i] = false; |
548 | } | 552 | } |