diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b4a8620..946680c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -104,11 +104,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
104 | WaitHandle m_coopSleepHandle; | 104 | WaitHandle m_coopSleepHandle; |
105 | 105 | ||
106 | /// <summary> | 106 | /// <summary> |
107 | /// The timer used by the ScriptInstance to measure how long the script has executed. | ||
108 | /// </summary> | ||
109 | private Stopwatch m_executionTimer; | ||
110 | |||
111 | /// <summary> | ||
112 | /// The item that hosts this script | 107 | /// The item that hosts this script |
113 | /// </summary> | 108 | /// </summary> |
114 | protected TaskInventoryItem m_item; | 109 | protected TaskInventoryItem m_item; |
@@ -267,14 +262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
267 | }; | 262 | }; |
268 | 263 | ||
269 | public void Initialize( | 264 | public void Initialize( |
270 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle, | 265 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) |
271 | Stopwatch executionTimer) | ||
272 | { | 266 | { |
273 | m_ScriptEngine = scriptEngine; | 267 | m_ScriptEngine = scriptEngine; |
274 | m_host = host; | 268 | m_host = host; |
275 | m_item = item; | 269 | m_item = item; |
276 | m_coopSleepHandle = coopSleepHandle; | 270 | m_coopSleepHandle = coopSleepHandle; |
277 | m_executionTimer = executionTimer; | ||
278 | 271 | ||
279 | LoadConfig(); | 272 | LoadConfig(); |
280 | 273 | ||
@@ -413,21 +406,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
413 | 406 | ||
414 | protected virtual void Sleep(int delay) | 407 | protected virtual void Sleep(int delay) |
415 | { | 408 | { |
416 | if (m_executionTimer != null) | 409 | if (m_coopSleepHandle == null) |
417 | m_executionTimer.Stop(); // sleep time doesn't count as execution time, since it doesn't use the CPU | 410 | System.Threading.Thread.Sleep(delay); |
418 | 411 | else | |
419 | try | 412 | CheckForCoopTermination(delay); |
420 | { | ||
421 | if (m_coopSleepHandle == null) | ||
422 | System.Threading.Thread.Sleep(delay); | ||
423 | else | ||
424 | CheckForCoopTermination(delay); | ||
425 | } | ||
426 | finally | ||
427 | { | ||
428 | if (m_executionTimer != null) | ||
429 | m_executionTimer.Start(); | ||
430 | } | ||
431 | } | 413 | } |
432 | 414 | ||
433 | /// <summary> | 415 | /// <summary> |