aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-24 00:03:44 +0000
committerJustin Clark-Casey (justincc)2013-01-24 00:03:44 +0000
commit55c6753b13d4c8cd69cc986db5f6e321b8e65bb7 (patch)
tree70ae7a976ba9be4e7e8d1cb98d3a6e61e4dfb7d4 /OpenSim/Framework/Util.cs
parentAdd information on ScriptStopStrategy to [XEngine] in OpenSimDefaults.ini and... (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-55c6753b13d4c8cd69cc986db5f6e321b8e65bb7.zip
opensim-SC_OLD-55c6753b13d4c8cd69cc986db5f6e321b8e65bb7.tar.gz
opensim-SC_OLD-55c6753b13d4c8cd69cc986db5f6e321b8e65bb7.tar.bz2
opensim-SC_OLD-55c6753b13d4c8cd69cc986db5f6e321b8e65bb7.tar.xz
Merge branch 'master' into cooptermination
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index f511494..9b1e97d 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -299,6 +299,18 @@ namespace OpenSim.Framework
299 x; 299 x;
300 } 300 }
301 301
302 // Clamp the maximum magnitude of a vector
303 public static Vector3 ClampV(Vector3 x, float max)
304 {
305 Vector3 ret = x;
306 float lenSq = x.LengthSquared();
307 if (lenSq > (max * max))
308 {
309 x = x / x.Length() * max;
310 }
311 return x;
312 }
313
302 // Inclusive, within range test (true if equal to the endpoints) 314 // Inclusive, within range test (true if equal to the endpoints)
303 public static bool InRange<T>(T x, T min, T max) 315 public static bool InRange<T>(T x, T min, T max)
304 where T : IComparable<T> 316 where T : IComparable<T>
@@ -1646,8 +1658,13 @@ namespace OpenSim.Framework
1646 if (m_ThreadPool != null) 1658 if (m_ThreadPool != null)
1647 throw new InvalidOperationException("SmartThreadPool is already initialized"); 1659 throw new InvalidOperationException("SmartThreadPool is already initialized");
1648 1660
1649 m_ThreadPool = new SmartThreadPool(2000, maxThreads, 2); 1661 STPStartInfo startInfo = new STPStartInfo();
1650 m_ThreadPool.Name = "Util"; 1662 startInfo.ThreadPoolName = "Util";
1663 startInfo.IdleTimeout = 2000;
1664 startInfo.MaxWorkerThreads = maxThreads;
1665 startInfo.MinWorkerThreads = 2;
1666
1667 m_ThreadPool = new SmartThreadPool(startInfo);
1651 } 1668 }
1652 1669
1653 public static int FireAndForgetCount() 1670 public static int FireAndForgetCount()