aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2016-07-12 23:23:47 +0100
committerUbitUmarov2016-07-12 23:23:47 +0100
commitabf423e361fa907f668b6ff7801d706629ce6e81 (patch)
tree2950100d274f5aa30e9017ef72630b5816f2e977
parent reduce some locks on culling checks (diff)
downloadopensim-SC_OLD-abf423e361fa907f668b6ff7801d706629ce6e81.zip
opensim-SC_OLD-abf423e361fa907f668b6ff7801d706629ce6e81.tar.gz
opensim-SC_OLD-abf423e361fa907f668b6ff7801d706629ce6e81.tar.bz2
opensim-SC_OLD-abf423e361fa907f668b6ff7801d706629ce6e81.tar.xz
be nicer to PIs (actually linux)
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs14
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs5
2 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 9d182b6..0e67095 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -2066,6 +2066,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2066 while (base.IsRunningOutbound) 2066 while (base.IsRunningOutbound)
2067 { 2067 {
2068 Scene.ThreadAlive(2); 2068 Scene.ThreadAlive(2);
2069
2070
2069 try 2071 try
2070 { 2072 {
2071 m_packetSent = false; 2073 m_packetSent = false;
@@ -2125,11 +2127,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2125 // If nothing was sent, sleep for the minimum amount of time before a 2127 // If nothing was sent, sleep for the minimum amount of time before a
2126 // token bucket could get more tokens 2128 // token bucket could get more tokens
2127 2129
2128 if (!m_packetSent) 2130 if(Scene.GetNumberOfClients() == 0)
2129 Thread.Sleep((int)TickCountResolution); 2131 {
2130 2132 Thread.Sleep(250); // be friendly to PIs, but how long ??
2131 // .... wrong core code removed 2133 }
2132 2134 else if (!m_packetSent)
2135// Thread.Sleep((int)TickCountResolution); outch this is bad on linux
2136 Thread.Sleep(15); // match the 16ms of windows7, dont ask 16 or win may decide to do 32ms.
2133 2137
2134 Watchdog.UpdateThread(); 2138 Watchdog.UpdateThread();
2135 } 2139 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index cf5705c..fac5547 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5409,6 +5409,11 @@ Label_GroupsDone:
5409 m_clientManager.ForEachSync(action); 5409 m_clientManager.ForEachSync(action);
5410 } 5410 }
5411 5411
5412 public int GetNumberOfClients()
5413 {
5414 return m_clientManager.Count;
5415 }
5416
5412 public bool TryGetClient(UUID avatarID, out IClientAPI client) 5417 public bool TryGetClient(UUID avatarID, out IClientAPI client)
5413 { 5418 {
5414 return m_clientManager.TryGetValue(avatarID, out client); 5419 return m_clientManager.TryGetValue(avatarID, out client);