aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs16
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 3a7e1c7..63f4800 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -91,7 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
91 /// Used for script sleeps when we are using co-operative script termination. 91 /// Used for script sleeps when we are using co-operative script termination.
92 /// </summary> 92 /// </summary>
93 /// <remarks>null if co-operative script termination is not active</remarks> 93 /// <remarks>null if co-operative script termination is not active</remarks>
94 EventWaitHandle m_coopSleepHandle; 94 WaitHandle m_coopSleepHandle;
95 95
96 /// <summary> 96 /// <summary>
97 /// The item that hosts this script 97 /// The item that hosts this script
@@ -118,7 +118,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
118 protected ISoundModule m_SoundModule = null; 118 protected ISoundModule m_SoundModule = null;
119 119
120 public void Initialize( 120 public void Initialize(
121 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, EventWaitHandle coopSleepHandle) 121 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
122 { 122 {
123 m_ScriptEngine = scriptEngine; 123 m_ScriptEngine = scriptEngine;
124 m_host = host; 124 m_host = host;
@@ -192,7 +192,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
192 { 192 {
193 if (m_coopSleepHandle == null) 193 if (m_coopSleepHandle == null)
194 System.Threading.Thread.Sleep(delay); 194 System.Threading.Thread.Sleep(delay);
195 else if (m_coopSleepHandle.WaitOne(delay)) 195 else
196 CheckForCoopTermination(delay);
197 }
198
199 /// <summary>
200 /// Check for co-operative termination.
201 /// </summary>
202 /// <param name='delay'>If called with 0, then just the check is performed with no wait.</param>
203 protected virtual void CheckForCoopTermination(int delay)
204 {
205 if (m_coopSleepHandle.WaitOne(delay))
196 throw new ScriptCoopStopException(); 206 throw new ScriptCoopStopException();
197 } 207 }
198 208