diff options
Diffstat (limited to '')
3 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index f68612c..35ae44c 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -52,7 +52,12 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
52 | { | 52 | { |
53 | bool Cancel(); | 53 | bool Cancel(); |
54 | void Abort(); | 54 | void Abort(); |
55 | bool Wait(TimeSpan t); | 55 | |
56 | /// <summary> | ||
57 | /// Wait for the work item to complete. | ||
58 | /// </summary> | ||
59 | /// <param name='t'>The number of milliseconds to wait. Must be >= -1 (Timeout.Infinite).</param> | ||
60 | bool Wait(int t); | ||
56 | } | 61 | } |
57 | 62 | ||
58 | /// <summary> | 63 | /// <summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index c8ced43..26850c4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -603,7 +603,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
603 | if (!m_coopTermination) | 603 | if (!m_coopTermination) |
604 | { | 604 | { |
605 | // If we're not co-operative terminating then try and wait for the event to complete before stopping | 605 | // If we're not co-operative terminating then try and wait for the event to complete before stopping |
606 | if (workItem.Wait(new TimeSpan((long)timeout * 100000))) | 606 | if (workItem.Wait(timeout)) |
607 | return true; | 607 | return true; |
608 | } | 608 | } |
609 | else | 609 | else |
@@ -618,7 +618,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
618 | 618 | ||
619 | // For now, we will wait forever since the event should always cleanly terminate once LSL loop | 619 | // For now, we will wait forever since the event should always cleanly terminate once LSL loop |
620 | // checking is implemented. May want to allow a shorter timeout option later. | 620 | // checking is implemented. May want to allow a shorter timeout option later. |
621 | if (workItem.Wait(TimeSpan.MaxValue)) | 621 | if (workItem.Wait(Timeout.Infinite)) |
622 | { | 622 | { |
623 | if (DebugLevel >= 1) | 623 | if (DebugLevel >= 1) |
624 | m_log.DebugFormat( | 624 | m_log.DebugFormat( |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs index 2ac5c31..8dd7677 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs | |||
@@ -57,8 +57,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
57 | wr.Abort(); | 57 | wr.Abort(); |
58 | } | 58 | } |
59 | 59 | ||
60 | public bool Wait(TimeSpan t) | 60 | public bool Wait(int t) |
61 | { | 61 | { |
62 | // We use the integer version of WaitAll because the current version of SmartThreadPool has a bug with the | ||
63 | // TimeSpan version. The number of milliseconds in TimeSpan is an int64 so when STP casts it down to an | ||
64 | // int (32-bit) we can end up with bad values. This occurs on Windows though curious not on Mono 2.10.8 | ||
65 | // (or very likely other versions of Mono at least up until 3.0.3). | ||
62 | return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false); | 66 | return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false); |
63 | } | 67 | } |
64 | } | 68 | } |