diff options
author | Melanie | 2013-01-24 00:25:08 +0000 |
---|---|---|
committer | Melanie | 2013-01-24 00:25:08 +0000 |
commit | be4c8c4931637b7b0849d12c634599c702483364 (patch) | |
tree | 9a49626efcc10f1272b37176616a41476b044045 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Merge branch 'master' into cooptermination (diff) | |
download | opensim-SC-be4c8c4931637b7b0849d12c634599c702483364.zip opensim-SC-be4c8c4931637b7b0849d12c634599c702483364.tar.gz opensim-SC-be4c8c4931637b7b0849d12c634599c702483364.tar.bz2 opensim-SC-be4c8c4931637b7b0849d12c634599c702483364.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 |
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 9df04df..70dea08 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
95 | /// Used for script sleeps when we are using co-operative script termination. | 95 | /// Used for script sleeps when we are using co-operative script termination. |
96 | /// </summary> | 96 | /// </summary> |
97 | /// <remarks>null if co-operative script termination is not active</remarks> | 97 | /// <remarks>null if co-operative script termination is not active</remarks> |
98 | EventWaitHandle m_coopSleepHandle; | 98 | WaitHandle m_coopSleepHandle; |
99 | 99 | ||
100 | /// <summary> | 100 | /// <summary> |
101 | /// The item that hosts this script | 101 | /// The item that hosts this script |
@@ -150,7 +150,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
150 | }; | 150 | }; |
151 | 151 | ||
152 | public void Initialize( | 152 | public void Initialize( |
153 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, EventWaitHandle coopSleepHandle) | 153 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) |
154 | { | 154 | { |
155 | m_lastSayShoutCheck = DateTime.UtcNow; | 155 | m_lastSayShoutCheck = DateTime.UtcNow; |
156 | 156 | ||
@@ -227,7 +227,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
227 | { | 227 | { |
228 | if (m_coopSleepHandle == null) | 228 | if (m_coopSleepHandle == null) |
229 | System.Threading.Thread.Sleep(delay); | 229 | System.Threading.Thread.Sleep(delay); |
230 | else if (m_coopSleepHandle.WaitOne(delay)) | 230 | else |
231 | CheckForCoopTermination(delay); | ||
232 | } | ||
233 | |||
234 | /// <summary> | ||
235 | /// Check for co-operative termination. | ||
236 | /// </summary> | ||
237 | /// <param name='delay'>If called with 0, then just the check is performed with no wait.</param> | ||
238 | protected virtual void CheckForCoopTermination(int delay) | ||
239 | { | ||
240 | if (m_coopSleepHandle.WaitOne(delay)) | ||
231 | throw new ScriptCoopStopException(); | 241 | throw new ScriptCoopStopException(); |
232 | } | 242 | } |
233 | 243 | ||