mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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
This commit is contained in:
@@ -2435,5 +2435,30 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
running = instance.Running;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SleepScript(UUID itemID, int delay)
|
||||
{
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
if (instance == null)
|
||||
return;
|
||||
|
||||
instance.ExecutionTimer.Stop();
|
||||
try
|
||||
{
|
||||
if (instance.CoopWaitHandle != null)
|
||||
{
|
||||
if (instance.CoopWaitHandle.WaitOne(delay))
|
||||
throw new ScriptCoopStopException();
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(delay);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
instance.ExecutionTimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user