aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-02-12 21:34:12 +0000
committerJustin Clark-Casey (justincc)2013-02-12 21:34:12 +0000
commita82bd5678ec14ea45f7ddcf54e4dd0af43b64c8c (patch)
treef54b50be843f78eb225c6b517913db89c2058d57 /OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
parentRe-enable subtest for single quoted token in TestJsonSetValueJson() (diff)
downloadopensim-SC_OLD-a82bd5678ec14ea45f7ddcf54e4dd0af43b64c8c.zip
opensim-SC_OLD-a82bd5678ec14ea45f7ddcf54e4dd0af43b64c8c.tar.gz
opensim-SC_OLD-a82bd5678ec14ea45f7ddcf54e4dd0af43b64c8c.tar.bz2
opensim-SC_OLD-a82bd5678ec14ea45f7ddcf54e4dd0af43b64c8c.tar.xz
Use an integer when specifying the XWorkItem wait rather than a TimeSpan to avoid a Windows casting issue in SmartThreadPool for large TimeSpans.
TimeSpan.Milliseconds is an int64. However, STP casts this to an int (32-bit). If TimeSpan.MaxValue is given then the casting results in an invalid value for the SDK WaitHandle.WaitAll() call. This was causing the co-op script termination regression tests to fail on Windows but not Mono 2.10.8 (which is perhaps not strict in the negative values that it accepts). Solution here is to use the int millisecondsTimeout STP call rather than the TimeSpan one. This also allows us to more clearly specify Timeout.Infinite rather than TimeSpan.MaxValue Thanks to Teravus for this spot.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 669cc37..bf19a42 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -595,7 +595,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
595 if (!m_coopTermination) 595 if (!m_coopTermination)
596 { 596 {
597 // If we're not co-operative terminating then try and wait for the event to complete before stopping 597 // If we're not co-operative terminating then try and wait for the event to complete before stopping
598 if (workItem.Wait(new TimeSpan((long)timeout * 100000))) 598 if (workItem.Wait(timeout))
599 return true; 599 return true;
600 } 600 }
601 else 601 else
@@ -610,7 +610,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
610 610
611 // For now, we will wait forever since the event should always cleanly terminate once LSL loop 611 // For now, we will wait forever since the event should always cleanly terminate once LSL loop
612 // checking is implemented. May want to allow a shorter timeout option later. 612 // checking is implemented. May want to allow a shorter timeout option later.
613 if (workItem.Wait(TimeSpan.MaxValue)) 613 if (workItem.Wait(Timeout.Infinite))
614 { 614 {
615 if (DebugLevel >= 1) 615 if (DebugLevel >= 1)
616 m_log.DebugFormat( 616 m_log.DebugFormat(