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/XEngine/XEngine.cs | |
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 '')
-rwxr-xr-x | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 62bf803..78d4ee9 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -2435,5 +2435,30 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
2435 | running = instance.Running; | 2435 | running = instance.Running; |
2436 | return true; | 2436 | return true; |
2437 | } | 2437 | } |
2438 | |||
2439 | public void SleepScript(UUID itemID, int delay) | ||
2440 | { | ||
2441 | IScriptInstance instance = GetInstance(itemID); | ||
2442 | if (instance == null) | ||
2443 | return; | ||
2444 | |||
2445 | instance.ExecutionTimer.Stop(); | ||
2446 | try | ||
2447 | { | ||
2448 | if (instance.CoopWaitHandle != null) | ||
2449 | { | ||
2450 | if (instance.CoopWaitHandle.WaitOne(delay)) | ||
2451 | throw new ScriptCoopStopException(); | ||
2452 | } | ||
2453 | else | ||
2454 | { | ||
2455 | Thread.Sleep(delay); | ||
2456 | } | ||
2457 | } | ||
2458 | finally | ||
2459 | { | ||
2460 | instance.ExecutionTimer.Start(); | ||
2461 | } | ||
2462 | } | ||
2438 | } | 2463 | } |
2439 | } | 2464 | } |