aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Instance
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-28 00:37:22 +0000
committerMelanie Thielker2008-08-28 00:37:22 +0000
commitbf4d1fbb8dbfe3470d4381542e586e44d84c2a01 (patch)
tree42f43e101b5b092cdc69f36ea1afc8c7d0f3f1fb /OpenSim/Region/ScriptEngine/Shared/Instance
parentRemove self-referential build dependency that breaks build under (diff)
downloadopensim-SC_OLD-bf4d1fbb8dbfe3470d4381542e586e44d84c2a01.zip
opensim-SC_OLD-bf4d1fbb8dbfe3470d4381542e586e44d84c2a01.tar.gz
opensim-SC_OLD-bf4d1fbb8dbfe3470d4381542e586e44d84c2a01.tar.bz2
opensim-SC_OLD-bf4d1fbb8dbfe3470d4381542e586e44d84c2a01.tar.xz
Refactor IScriptInstance / IScriptEngine to use a generic IScriptWorkItem,
which is a thin wrapper around a IWorkItemResult from the SmartThreadPool. However, it is very easy to reimplement on top of basic threading and therefore makes the IScriptInstance class independent of the specific threading implementation.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index ff50396..8ce1413 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
53 public class ScriptInstance : IScriptInstance 53 public class ScriptInstance : IScriptInstance
54 { 54 {
55 private IScriptEngine m_Engine; 55 private IScriptEngine m_Engine;
56 private IWorkItemResult m_CurrentResult=null; 56 private IScriptWorkItem m_CurrentResult=null;
57 private Queue m_EventQueue = new Queue(32); 57 private Queue m_EventQueue = new Queue(32);
58 private bool m_RunEvents = false; 58 private bool m_RunEvents = false;
59 private LLUUID m_ItemID; 59 private LLUUID m_ItemID;
@@ -346,7 +346,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
346 346
347 public bool Stop(int timeout) 347 public bool Stop(int timeout)
348 { 348 {
349 IWorkItemResult result; 349 IScriptWorkItem result;
350 350
351 lock (m_EventQueue) 351 lock (m_EventQueue)
352 { 352 {
@@ -370,7 +370,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
370 m_RunEvents = false; 370 m_RunEvents = false;
371 } 371 }
372 372
373 if (SmartThreadPool.WaitAll(new IWorkItemResult[] {result}, new TimeSpan((long)timeout * 100000), false)) 373 if (result.Wait(new TimeSpan((long)timeout * 100000)))
374 { 374 {
375 return true; 375 return true;
376 } 376 }