aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorDiva Canto2009-08-19 00:33:02 -0700
committerDiva Canto2009-08-19 00:33:02 -0700
commit4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af (patch)
tree135b6061eb7589d31d6e1cb6d7f5b67dfd09a3b1 /OpenSim/Region/Framework/Scenes
parentMerge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.zip
opensim-SC_OLD-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.tar.gz
opensim-SC_OLD-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.tar.bz2
opensim-SC_OLD-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.tar.xz
Async purge so that the client thread doesn't wait.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index a2414e5..77b980c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using System.Threading; 30using System.Threading;
30using OpenMetaverse; 31using OpenMetaverse;
@@ -558,15 +559,34 @@ namespace OpenSim.Region.Framework.Scenes
558 /// <param name="remoteClient"></param> 559 /// <param name="remoteClient"></param>
559 /// <param name="folderID"></param> 560 /// <param name="folderID"></param>
560 561
562 delegate void PurgeFolderDelegate(UUID userID, UUID folder);
563
561 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) 564 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
562 { 565 {
563 InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); 566 PurgeFolderDelegate d = PurgeFolderAsync;
567 try
568 {
569 d.BeginInvoke(remoteClient.AgentId, folderID, PurgeFolderCompleted, d);
570 }
571 catch (Exception e)
572 {
573 m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message);
574 }
575 }
576
577
578 private void PurgeFolderAsync(UUID userID, UUID folderID)
579 {
580 InventoryFolderBase folder = new InventoryFolderBase(folderID, userID);
564 581
565 if (InventoryService.PurgeFolder(folder)) 582 if (InventoryService.PurgeFolder(folder))
566 m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); 583 m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID);
567 else 584 else
568 m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID); 585 m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID);
569 } 586 }
570 587
588 private void PurgeFolderCompleted(IAsyncResult iar)
589 {
590 }
571 } 591 }
572} 592}