diff options
author | Justin Clark-Casey (justincc) | 2014-07-02 23:48:44 +0100 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:50:10 +0100 |
commit | ba745a524d4f13552f8ed3827a7315b3000cbe53 (patch) | |
tree | e0242a1495d2d3119a3559181186a1e16d61fd0a /OpenSim/Framework | |
parent | minor: Change default max phys prim size in code to match OpenSimDefaults.ini (diff) | |
download | opensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.zip opensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.tar.gz opensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.tar.bz2 opensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.tar.xz |
Actually call Close() for shared region modules when the simulator is being shutdown.
Adds regression test for this case.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 8 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 54e6061..828a852 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -57,6 +57,11 @@ namespace OpenSim.Framework.Servers | |||
57 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 57 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Used by tests to suppress Environment.Exit(0) so that post-run operations are possible. | ||
61 | /// </summary> | ||
62 | public bool SuppressExit { get; set; } | ||
63 | |||
64 | /// <summary> | ||
60 | /// This will control a periodic log printout of the current 'show stats' (if they are active) for this | 65 | /// This will control a periodic log printout of the current 'show stats' (if they are active) for this |
61 | /// server. | 66 | /// server. |
62 | /// </summary> | 67 | /// </summary> |
@@ -109,7 +114,8 @@ namespace OpenSim.Framework.Servers | |||
109 | 114 | ||
110 | base.ShutdownSpecific(); | 115 | base.ShutdownSpecific(); |
111 | 116 | ||
112 | Environment.Exit(0); | 117 | if (!SuppressExit) |
118 | Environment.Exit(0); | ||
113 | } | 119 | } |
114 | 120 | ||
115 | /// <summary> | 121 | /// <summary> |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 740e55a..729281c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1964,10 +1964,15 @@ namespace OpenSim.Framework | |||
1964 | { | 1964 | { |
1965 | if (maxThreads < 2) | 1965 | if (maxThreads < 2) |
1966 | throw new ArgumentOutOfRangeException("maxThreads", "maxThreads must be greater than 2"); | 1966 | throw new ArgumentOutOfRangeException("maxThreads", "maxThreads must be greater than 2"); |
1967 | |||
1967 | if (minThreads > maxThreads || minThreads < 2) | 1968 | if (minThreads > maxThreads || minThreads < 2) |
1968 | throw new ArgumentOutOfRangeException("minThreads", "minThreads must be greater than 2 and less than or equal to maxThreads"); | 1969 | throw new ArgumentOutOfRangeException("minThreads", "minThreads must be greater than 2 and less than or equal to maxThreads"); |
1970 | |||
1969 | if (m_ThreadPool != null) | 1971 | if (m_ThreadPool != null) |
1970 | throw new InvalidOperationException("SmartThreadPool is already initialized"); | 1972 | { |
1973 | m_log.Warn("SmartThreadPool is already initialized. Ignoring request."); | ||
1974 | return; | ||
1975 | } | ||
1971 | 1976 | ||
1972 | STPStartInfo startInfo = new STPStartInfo(); | 1977 | STPStartInfo startInfo = new STPStartInfo(); |
1973 | startInfo.ThreadPoolName = "Util"; | 1978 | startInfo.ThreadPoolName = "Util"; |