diff options
author | Melanie Thielker | 2015-08-17 21:46:30 +0200 |
---|---|---|
committer | Melanie Thielker | 2015-08-17 21:46:30 +0200 |
commit | c53f732163b391e4bcd33c8acb917deb7598e0a8 (patch) | |
tree | 6b396d1678db3ddbdecef28099666461452cf81c /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Revert "When scripts are sleeping, don't count that as execution time" (diff) | |
download | opensim-SC-c53f732163b391e4bcd33c8acb917deb7598e0a8.zip opensim-SC-c53f732163b391e4bcd33c8acb917deb7598e0a8.tar.gz opensim-SC-c53f732163b391e4bcd33c8acb917deb7598e0a8.tar.bz2 opensim-SC-c53f732163b391e4bcd33c8acb917deb7598e0a8.tar.xz |
Change the IScriptApi back to it's original form, removing XEngine
specific additions that should not have been there in the first place.
Sleeping and time measurement are now completely internal to XEngine
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
4 files changed, 6 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 946680c..f364032 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -101,8 +101,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
101 | /// Used for script sleeps when we are using co-operative script termination. | 101 | /// Used for script sleeps when we are using co-operative script termination. |
102 | /// </summary> | 102 | /// </summary> |
103 | /// <remarks>null if co-operative script termination is not active</remarks> | 103 | /// <remarks>null if co-operative script termination is not active</remarks> |
104 | WaitHandle m_coopSleepHandle; | ||
105 | |||
106 | /// <summary> | 104 | /// <summary> |
107 | /// The item that hosts this script | 105 | /// The item that hosts this script |
108 | /// </summary> | 106 | /// </summary> |
@@ -262,12 +260,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
262 | }; | 260 | }; |
263 | 261 | ||
264 | public void Initialize( | 262 | public void Initialize( |
265 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) | 263 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) |
266 | { | 264 | { |
267 | m_ScriptEngine = scriptEngine; | 265 | m_ScriptEngine = scriptEngine; |
268 | m_host = host; | 266 | m_host = host; |
269 | m_item = item; | 267 | m_item = item; |
270 | m_coopSleepHandle = coopSleepHandle; | ||
271 | 268 | ||
272 | LoadConfig(); | 269 | LoadConfig(); |
273 | 270 | ||
@@ -406,21 +403,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
406 | 403 | ||
407 | protected virtual void Sleep(int delay) | 404 | protected virtual void Sleep(int delay) |
408 | { | 405 | { |
409 | if (m_coopSleepHandle == null) | 406 | m_ScriptEngine.SleepScript(m_item.ItemID, delay); |
410 | System.Threading.Thread.Sleep(delay); | ||
411 | else | ||
412 | CheckForCoopTermination(delay); | ||
413 | } | 407 | } |
414 | 408 | ||
415 | /// <summary> | 409 | /// <summary> |
416 | /// Check for co-operative termination. | 410 | /// Check for co-operative termination. |
417 | /// </summary> | 411 | /// </summary> |
418 | /// <param name='delay'>If called with 0, then just the check is performed with no wait.</param> | 412 | /// <param name='delay'>If called with 0, then just the check is performed with no wait.</param> |
419 | protected virtual void CheckForCoopTermination(int delay) | ||
420 | { | ||
421 | if (m_coopSleepHandle.WaitOne(delay)) | ||
422 | throw new ScriptCoopStopException(); | ||
423 | } | ||
424 | 413 | ||
425 | public Scene World | 414 | public Scene World |
426 | { | 415 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 3406aea..e5e43f8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
63 | internal IScriptModuleComms m_comms = null; | 63 | internal IScriptModuleComms m_comms = null; |
64 | 64 | ||
65 | public void Initialize( | 65 | public void Initialize( |
66 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) | 66 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) |
67 | { | 67 | { |
68 | m_ScriptEngine = scriptEngine; | 68 | m_ScriptEngine = scriptEngine; |
69 | m_host = host; | 69 | m_host = host; |
@@ -833,4 +833,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
833 | return success; | 833 | return success; |
834 | } | 834 | } |
835 | } | 835 | } |
836 | } \ No newline at end of file | 836 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 92dd813..9929dac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
66 | internal IScriptModuleComms m_comms = null; | 66 | internal IScriptModuleComms m_comms = null; |
67 | 67 | ||
68 | public void Initialize( | 68 | public void Initialize( |
69 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) | 69 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) |
70 | { | 70 | { |
71 | m_ScriptEngine = scriptEngine; | 71 | m_ScriptEngine = scriptEngine; |
72 | m_host = host; | 72 | m_host = host; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 123f8ca..c1f1ed5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -145,7 +145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
145 | protected IUrlModule m_UrlModule = null; | 145 | protected IUrlModule m_UrlModule = null; |
146 | 146 | ||
147 | public void Initialize( | 147 | public void Initialize( |
148 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) | 148 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) |
149 | { | 149 | { |
150 | m_ScriptEngine = scriptEngine; | 150 | m_ScriptEngine = scriptEngine; |
151 | m_host = host; | 151 | m_host = host; |