aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Instance
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs23
1 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 887a317..229180f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -241,7 +241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
241 if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op") 241 if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op")
242 { 242 {
243 m_coopTermination = true; 243 m_coopTermination = true;
244 m_coopSleepHandle = new AutoResetEvent(false); 244 m_coopSleepHandle = new XEngineEventWaitHandle(false, EventResetMode.AutoReset);
245 } 245 }
246 } 246 }
247 247
@@ -1201,4 +1201,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
1201 Suspended = false; 1201 Suspended = false;
1202 } 1202 }
1203 } 1203 }
1204} 1204
1205 /// <summary>
1206 /// Xengine event wait handle.
1207 /// </summary>
1208 /// <remarks>
1209 /// This class exists becase XEngineScriptBase gets a reference to this wait handle. We need to make sure that
1210 /// when scripts are running in different AppDomains the lease does not expire.
1211 /// FIXME: Like LSL_Api, etc., this effectively leaks memory since the GC will never collect it. To avoid this,
1212 /// proper remoting sponsorship needs to be implemented across the board.
1213 /// </remarks>
1214 public class XEngineEventWaitHandle : EventWaitHandle
1215 {
1216 public XEngineEventWaitHandle(bool initialState, EventResetMode mode) : base(initialState, mode) {}
1217
1218 public override Object InitializeLifetimeService()
1219 {
1220 return null;
1221 }
1222 }
1223} \ No newline at end of file