diff options
author | UbitUmarov | 2017-06-09 17:32:07 +0100 |
---|---|---|
committer | UbitUmarov | 2017-06-09 17:32:07 +0100 |
commit | f69e48bedca1e3aaae7ab0a1d681fccfe7af862f (patch) | |
tree | e2a79d801e17a29513dc508b1ce9cfdfba98c9de /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Minor changes to commented text in bin/OpenSim.ini.example (diff) | |
download | opensim-SC-f69e48bedca1e3aaae7ab0a1d681fccfe7af862f.zip opensim-SC-f69e48bedca1e3aaae7ab0a1d681fccfe7af862f.tar.gz opensim-SC-f69e48bedca1e3aaae7ab0a1d681fccfe7af862f.tar.bz2 opensim-SC-f69e48bedca1e3aaae7ab0a1d681fccfe7af862f.tar.xz |
make SendCoarseLocations async, since it is http. Make some actions use thread from pool and not a new one. Threading does need a deep cleanup one of this days. This stops mantis 8183 warnings, but as side effect only
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e1e06d0..ebef158 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -394,6 +394,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
394 | /// asynchronously from the update loop. | 394 | /// asynchronously from the update loop. |
395 | /// </summary> | 395 | /// </summary> |
396 | private bool m_cleaningTemps = false; | 396 | private bool m_cleaningTemps = false; |
397 | private bool m_sendingCoarseLocations = false; // same for async course locations sending | ||
397 | 398 | ||
398 | /// <summary> | 399 | /// <summary> |
399 | /// Used to control main scene thread looping time when not updating via timer. | 400 | /// Used to control main scene thread looping time when not updating via timer. |
@@ -1654,18 +1655,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1654 | if (Frame % m_update_entitymovement == 0) | 1655 | if (Frame % m_update_entitymovement == 0) |
1655 | m_sceneGraph.UpdateScenePresenceMovement(); | 1656 | m_sceneGraph.UpdateScenePresenceMovement(); |
1656 | 1657 | ||
1657 | if (Frame % (m_update_coarse_locations) == 0) | 1658 | if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations) |
1658 | { | 1659 | { |
1659 | List<Vector3> coarseLocations; | 1660 | m_sendingCoarseLocations = true; |
1660 | List<UUID> avatarUUIDs; | 1661 | WorkManager.RunInThreadPool( |
1661 | 1662 | delegate | |
1662 | SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); | 1663 | { |
1663 | // Send coarse locations to clients | 1664 | List<Vector3> coarseLocations; |
1664 | ForEachScenePresence(delegate(ScenePresence presence) | 1665 | List<UUID> avatarUUIDs; |
1665 | { | 1666 | SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); |
1666 | presence.SendCoarseLocations(coarseLocations, avatarUUIDs); | 1667 | // Send coarse locations to clients |
1667 | }); | 1668 | ForEachScenePresence(delegate(ScenePresence presence) |
1669 | { | ||
1670 | presence.SendCoarseLocations(coarseLocations, avatarUUIDs); | ||
1671 | }); | ||
1672 | m_sendingCoarseLocations = false; | ||
1673 | }, null, string.Format("SendCoarseLocations ({0})", Name)); | ||
1668 | } | 1674 | } |
1675 | |||
1669 | // Get the simulation frame time that the avatar force input | 1676 | // Get the simulation frame time that the avatar force input |
1670 | // took | 1677 | // took |
1671 | tmpMS2 = Util.GetTimeStampMS(); | 1678 | tmpMS2 = Util.GetTimeStampMS(); |
@@ -1708,7 +1715,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1708 | if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps) | 1715 | if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps) |
1709 | { | 1716 | { |
1710 | m_cleaningTemps = true; | 1717 | m_cleaningTemps = true; |
1711 | WorkManager.RunInThread( | 1718 | WorkManager.RunInThreadPool( |
1712 | delegate { CleanTempObjects(); m_cleaningTemps = false; }, null, string.Format("CleanTempObjects ({0})", Name)); | 1719 | delegate { CleanTempObjects(); m_cleaningTemps = false; }, null, string.Format("CleanTempObjects ({0})", Name)); |
1713 | tmpMS2 = Util.GetTimeStampMS(); | 1720 | tmpMS2 = Util.GetTimeStampMS(); |
1714 | tempOnRezMS = (float)(tmpMS2 - tmpMS); // bad.. counts the FireAndForget, not CleanTempObjects | 1721 | tempOnRezMS = (float)(tmpMS2 - tmpMS); // bad.. counts the FireAndForget, not CleanTempObjects |
@@ -1936,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1936 | if (!m_backingup) | 1943 | if (!m_backingup) |
1937 | { | 1944 | { |
1938 | m_backingup = true; | 1945 | m_backingup = true; |
1939 | WorkManager.RunInThread(o => Backup(false), null, string.Format("BackupWorker ({0})", Name)); | 1946 | WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name)); |
1940 | } | 1947 | } |
1941 | } | 1948 | } |
1942 | 1949 | ||