From 828e4a5b093c6a67302776137fc0bdbcfded4c9b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 15 Nov 2011 20:26:42 +0000 Subject: Add comments about trying to avoid synchronous work off the EventManager.OnMakeRootAgent event since this is on the critical path for transfer of avatars from one region to another. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index bf9ad65..4906665 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -212,10 +212,15 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnMakeChildAgentDelegate(ScenePresence presence); public event OnMakeChildAgentDelegate OnMakeChildAgent; - public delegate void OnMakeRootAgentDelegate(ScenePresence presence); public delegate void OnSaveNewWindlightProfileDelegate(); public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user); - public event OnMakeRootAgentDelegate OnMakeRootAgent; + + /// + /// This event is on the critical path for transferring an avatar from one region to another. Try and do + /// as little work on this event as possible, or do work asynchronously. + /// + public event Action OnMakeRootAgent; + public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; @@ -1322,10 +1327,10 @@ namespace OpenSim.Region.Framework.Scenes public void TriggerOnMakeRootAgent(ScenePresence presence) { - OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent; + Action handlerMakeRootAgent = OnMakeRootAgent; if (handlerMakeRootAgent != null) { - foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList()) + foreach (Action d in handlerMakeRootAgent.GetInvocationList()) { try { -- cgit v1.1