mirror of
https://github.com/opensim/opensim.git
synced 2026-06-19 03:36:18 +08:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2d327b70b | ||
|
|
30638317ab | ||
|
|
689da0f14d | ||
|
|
6d3b2d2cf7 | ||
|
|
78debc981f | ||
|
|
e3f01f23af | ||
|
|
f28a592310 | ||
|
|
4c4cc917b4 | ||
|
|
430000ad24 | ||
|
|
eab57cdd13 | ||
|
|
5b60f632c9 | ||
|
|
d1320993a4 | ||
|
|
319069d193 | ||
|
|
82268d715e | ||
|
|
efcbae372b | ||
|
|
6e5d352bf6 | ||
|
|
8f32e16497 | ||
|
|
c42e2c6906 |
@@ -1623,6 +1623,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
// Long Poll Service Manager with 3 worker threads a 25 second timeout for no events
|
||||
m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000);
|
||||
m_PollServiceManager.Start();
|
||||
HTTPDRunning = true;
|
||||
|
||||
//HttpListenerContext context;
|
||||
@@ -1673,6 +1674,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
HTTPDRunning = false;
|
||||
try
|
||||
{
|
||||
m_PollServiceManager.Stop();
|
||||
|
||||
m_httpListener2.ExceptionThrown -= httpServerException;
|
||||
//m_httpListener2.DisconnectHandler = null;
|
||||
|
||||
|
||||
@@ -45,19 +45,26 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
private uint m_WorkerThreadCount = 0;
|
||||
private Thread[] m_workerThreads;
|
||||
private PollServiceWorkerThread[] m_PollServiceWorkerThreads;
|
||||
private bool m_running = true;
|
||||
private volatile bool m_running = true;
|
||||
private int m_pollTimeout;
|
||||
|
||||
public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
|
||||
{
|
||||
m_server = pSrv;
|
||||
m_WorkerThreadCount = pWorkerThreadCount;
|
||||
m_pollTimeout = pTimeout;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
m_running = true;
|
||||
m_workerThreads = new Thread[m_WorkerThreadCount];
|
||||
m_PollServiceWorkerThreads = new PollServiceWorkerThread[m_WorkerThreadCount];
|
||||
|
||||
//startup worker threads
|
||||
for (uint i = 0; i < m_WorkerThreadCount; i++)
|
||||
{
|
||||
m_PollServiceWorkerThreads[i] = new PollServiceWorkerThread(m_server, pTimeout);
|
||||
m_PollServiceWorkerThreads[i] = new PollServiceWorkerThread(m_server, m_pollTimeout);
|
||||
m_PollServiceWorkerThreads[i].ReQueue += ReQueueEvent;
|
||||
|
||||
m_workerThreads[i]
|
||||
@@ -136,8 +143,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
}
|
||||
|
||||
~PollServiceRequestManager()
|
||||
public void Stop()
|
||||
{
|
||||
m_running = false;
|
||||
|
||||
foreach (object o in m_requests)
|
||||
{
|
||||
PollServiceHttpRequest req = (PollServiceHttpRequest) o;
|
||||
@@ -151,8 +160,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
t.Abort();
|
||||
}
|
||||
|
||||
m_running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace OpenSim
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7.5";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.RC2;
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Release;
|
||||
|
||||
public enum Flavour
|
||||
{
|
||||
|
||||
@@ -1658,8 +1658,13 @@ namespace OpenSim.Framework
|
||||
if (m_ThreadPool != null)
|
||||
throw new InvalidOperationException("SmartThreadPool is already initialized");
|
||||
|
||||
m_ThreadPool = new SmartThreadPool(2000, maxThreads, 2);
|
||||
m_ThreadPool.Name = "Util";
|
||||
STPStartInfo startInfo = new STPStartInfo();
|
||||
startInfo.ThreadPoolName = "Util";
|
||||
startInfo.IdleTimeout = 2000;
|
||||
startInfo.MaxWorkerThreads = maxThreads;
|
||||
startInfo.MinWorkerThreads = 2;
|
||||
|
||||
m_ThreadPool = new SmartThreadPool(startInfo);
|
||||
}
|
||||
|
||||
public static int FireAndForgetCount()
|
||||
|
||||
@@ -617,7 +617,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
= new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero);
|
||||
|
||||
prim.Scale = scale;
|
||||
prim.OffsetPosition = position;
|
||||
//prim.OffsetPosition = position;
|
||||
rotations.Add(rotation);
|
||||
positions.Add(position);
|
||||
prim.UUID = UUID.Random();
|
||||
@@ -641,25 +641,40 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
grp.AddPart(prim);
|
||||
}
|
||||
|
||||
// Fix first link number
|
||||
Vector3 rootPos = positions[0];
|
||||
|
||||
if (grp.Parts.Length > 1)
|
||||
{
|
||||
// Fix first link number
|
||||
grp.RootPart.LinkNum++;
|
||||
|
||||
Vector3 rootPos = positions[0];
|
||||
grp.AbsolutePosition = rootPos;
|
||||
for (int i = 0; i < positions.Count; i++)
|
||||
Quaternion rootRotConj = Quaternion.Conjugate(rotations[0]);
|
||||
Quaternion tmprot;
|
||||
Vector3 offset;
|
||||
|
||||
// fix children rotations and positions
|
||||
for (int i = 1; i < rotations.Count; i++)
|
||||
{
|
||||
tmprot = rotations[i];
|
||||
tmprot = rootRotConj * tmprot;
|
||||
|
||||
grp.Parts[i].RotationOffset = tmprot;
|
||||
|
||||
offset = positions[i] - rootPos;
|
||||
|
||||
offset *= rootRotConj;
|
||||
grp.Parts[i].OffsetPosition = offset;
|
||||
}
|
||||
|
||||
grp.AbsolutePosition = rootPos;
|
||||
grp.UpdateGroupRotationR(rotations[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3 offset = positions[i] - rootPos;
|
||||
grp.Parts[i].OffsetPosition = offset;
|
||||
grp.AbsolutePosition = rootPos;
|
||||
grp.UpdateGroupRotationR(rotations[0]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < rotations.Count; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
grp.Parts[i].RotationOffset = rotations[i];
|
||||
}
|
||||
|
||||
grp.UpdateGroupRotationR(rotations[0]);
|
||||
data = ASCIIEncoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(grp));
|
||||
}
|
||||
|
||||
|
||||
@@ -214,9 +214,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
public void HandleTaskItemUpdateFromTransaction(
|
||||
IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[ASSET TRANSACTION MODULE] Called HandleTaskItemUpdateFromTransaction with item {0} in {1} for {2} in {3}",
|
||||
item.Name, part.Name, remoteClient.Name, m_Scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET TRANSACTION MODULE]: Called HandleTaskItemUpdateFromTransaction with item {0} in {1} for {2} in {3}",
|
||||
// item.Name, part.Name, remoteClient.Name, m_Scene.RegionInfo.RegionName);
|
||||
|
||||
AgentAssetTransactions transactions =
|
||||
GetUserTransactions(remoteClient.AgentId);
|
||||
@@ -230,15 +230,17 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="transaction"></param>
|
||||
/// <param name="transactionID"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="data"></param></param>
|
||||
/// <param name="tempFile"></param>
|
||||
public void HandleUDPUploadRequest(IClientAPI remoteClient,
|
||||
UUID assetID, UUID transaction, sbyte type, byte[] data,
|
||||
UUID assetID, UUID transactionID, sbyte type, byte[] data,
|
||||
bool storeLocal, bool tempFile)
|
||||
{
|
||||
// m_log.Debug("HandleUDPUploadRequest - assetID: " + assetID.ToString() + " transaction: " + transaction.ToString() + " type: " + type.ToString() + " storelocal: " + storeLocal + " tempFile: " + tempFile);
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET TRANSACTION MODULE]: HandleUDPUploadRequest - assetID: {0}, transaction {1}, type {2}, storeLocal {3}, tempFile {4}, data.Length {5}",
|
||||
// assetID, transactionID, type, storeLocal, tempFile, data.Length);
|
||||
|
||||
if (((AssetType)type == AssetType.Texture ||
|
||||
(AssetType)type == AssetType.Sound ||
|
||||
@@ -274,8 +276,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
}
|
||||
|
||||
AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId);
|
||||
AssetXferUploader uploader = transactions.RequestXferUploader(transaction);
|
||||
uploader.StartUpload(remoteClient, assetID, transaction, type, data, storeLocal, tempFile);
|
||||
AssetXferUploader uploader = transactions.RequestXferUploader(transactionID);
|
||||
uploader.StartUpload(remoteClient, assetID, transactionID, type, data, storeLocal, tempFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -321,7 +321,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
// to avoid a race condition when the appearance module retrieves the item to set the asset id in
|
||||
// the AvatarAppearance structure.
|
||||
item.AssetID = m_asset.FullID;
|
||||
m_Scene.InventoryService.UpdateItem(item);
|
||||
if (item.AssetID != UUID.Zero)
|
||||
m_Scene.InventoryService.UpdateItem(item);
|
||||
|
||||
if (m_uploadState == UploadState.Complete)
|
||||
{
|
||||
|
||||
@@ -487,6 +487,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count);
|
||||
|
||||
if (coa.Objects.Count == 0)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[INVENTORY ARCHIVE READ REQUEST]: Aborting load of coalesced object from asset {0} as it has zero loaded components",
|
||||
assetId);
|
||||
return false;
|
||||
}
|
||||
|
||||
sceneObjects.AddRange(coa.Objects);
|
||||
}
|
||||
@@ -495,7 +503,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
|
||||
|
||||
if (deserializedObject != null)
|
||||
{
|
||||
sceneObjects.Add(deserializedObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[INVENTORY ARCHIVE READ REQUEST]: Aborting load of object from asset {0} as deserialization failed",
|
||||
assetId);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectGroup sog in sceneObjects)
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Framework.InterfaceCommander
|
||||
{
|
||||
@@ -152,6 +153,9 @@ namespace OpenSim.Region.CoreModules.Framework.InterfaceCommander
|
||||
case "Boolean":
|
||||
m_args[i].ArgumentValue = Boolean.Parse(arg.ToString());
|
||||
break;
|
||||
case "UUID":
|
||||
m_args[i].ArgumentValue = UUID.Parse(arg.ToString());
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("ERROR: Unknown desired type for argument " + m_args[i].Name + " on command " + m_name);
|
||||
break;
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
m_module.Scene.RegionInfo.RegionSettings.Save();
|
||||
m_module.TriggerRegionInfoChange();
|
||||
m_module.sendRegionInfoPacketToAll();
|
||||
m_module.sendRegionHandshakeToAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,11 +592,11 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
cdl.AddRow(
|
||||
"LightColor",
|
||||
string.Format("<{0},{1},{2},{3}>", s.LightColorR, s.LightColorB, s.LightColorG, s.LightColorA));
|
||||
cdl.AddRow("FlexiDrag", s.LightCutoff);
|
||||
cdl.AddRow("FlexiDrag", s.LightEntry);
|
||||
cdl.AddRow("FlexiDrag", s.LightFalloff);
|
||||
cdl.AddRow("FlexiDrag", s.LightIntensity);
|
||||
cdl.AddRow("FlexiDrag", s.LightRadius);
|
||||
cdl.AddRow("LightCutoff", s.LightCutoff);
|
||||
cdl.AddRow("LightEntry", s.LightEntry);
|
||||
cdl.AddRow("LightFalloff", s.LightFalloff);
|
||||
cdl.AddRow("LightIntensity", s.LightIntensity);
|
||||
cdl.AddRow("LightRadius", s.LightRadius);
|
||||
cdl.AddRow("Media", string.Format("{0} entries", s.Media != null ? s.Media.Count.ToString() : "n/a"));
|
||||
cdl.AddRow("PathBegin", s.PathBegin);
|
||||
cdl.AddRow("PathEnd", s.PathEnd);
|
||||
|
||||
@@ -407,16 +407,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (item.Owner != remoteClient.AgentId)
|
||||
return;
|
||||
|
||||
if (UUID.Zero == transactionID)
|
||||
{
|
||||
item.Name = itemUpd.Name;
|
||||
item.Description = itemUpd.Description;
|
||||
item.Name = itemUpd.Name;
|
||||
item.Description = itemUpd.Description;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[USER INVENTORY]: itemUpd {0} {1} {2} {3}, item {4} {5} {6} {7}",
|
||||
// itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags,
|
||||
// item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions);
|
||||
|
||||
if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid
|
||||
{
|
||||
if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
|
||||
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
|
||||
item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
|
||||
@@ -451,7 +451,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
InventoryService.UpdateItem(item);
|
||||
}
|
||||
else
|
||||
|
||||
if (UUID.Zero != transactionID)
|
||||
{
|
||||
if (AgentTransactionsModule != null)
|
||||
{
|
||||
|
||||
@@ -42,9 +42,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
/// <summary>
|
||||
/// Serialize and deserialize coalesced scene objects.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Deserialization not yet here.
|
||||
/// </remarks>
|
||||
public class CoalescedSceneObjectsSerializer
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -128,6 +125,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
// m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml);
|
||||
|
||||
coa = null;
|
||||
int i = 0;
|
||||
|
||||
using (StringReader sr = new StringReader(xml))
|
||||
{
|
||||
@@ -153,7 +151,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
if (reader.Name == "SceneObjectGroup")
|
||||
{
|
||||
string soXml = reader.ReadOuterXml();
|
||||
coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml));
|
||||
|
||||
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(soXml);
|
||||
|
||||
if (so != null)
|
||||
{
|
||||
coa.Add(so);
|
||||
}
|
||||
else
|
||||
{
|
||||
// XXX: Possibly we should fail outright here rather than continuing if a particular component of the
|
||||
// coalesced object fails to load.
|
||||
m_log.WarnFormat(
|
||||
"[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.",
|
||||
i);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
base.SetUp();
|
||||
|
||||
IConfigSource config = new IniConfigSource();
|
||||
config.AddConfig("NPC");
|
||||
config.Configs["NPC"].Set("Enabled", "true");
|
||||
|
||||
@@ -1668,10 +1668,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
part.Shape.FlexiForceX = (float)Force.x;
|
||||
part.Shape.FlexiForceY = (float)Force.y;
|
||||
part.Shape.FlexiForceZ = (float)Force.z;
|
||||
part.Shape.PathCurve = 0x80;
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
part.ScheduleFullUpdate();
|
||||
part.Shape.PathCurve = (byte)Extrusion.Flexible;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Other values not set, they do not seem to be sent to the viewer
|
||||
// Setting PathCurve appears to be what actually toggles the check box and turns Flexi on and off
|
||||
part.Shape.PathCurve = (byte)Extrusion.Straight;
|
||||
part.Shape.FlexiEntry = false;
|
||||
}
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
part.ScheduleFullUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -5770,13 +5777,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (parcelOwned && land.LandData.OwnerID == id ||
|
||||
parcel && land.LandData.GlobalID == id)
|
||||
{
|
||||
result.Add(ssp.UUID.ToString());
|
||||
result.Add(new LSL_Key(ssp.UUID.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(ssp.UUID.ToString());
|
||||
result.Add(new LSL_Key(ssp.UUID.ToString()));
|
||||
}
|
||||
}
|
||||
// Maximum of 100 results
|
||||
|
||||
@@ -47,7 +47,6 @@ using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
|
||||
using OpenSim.Region.ScriptEngine.Shared.CodeTools;
|
||||
using OpenSim.Region.ScriptEngine.Shared.Instance;
|
||||
using OpenSim.Region.ScriptEngine.Shared.Api;
|
||||
@@ -606,7 +605,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Queue eq = instance.EventQueue;
|
||||
|
||||
sb.AppendFormat("Script name : {0}\n", instance.ScriptName);
|
||||
sb.AppendFormat("Status : {0}\n", status);
|
||||
@@ -1486,7 +1484,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
m_MaxScriptQueue = maxScriptQueue;
|
||||
|
||||
STPStartInfo startInfo = new STPStartInfo();
|
||||
startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini
|
||||
startInfo.ThreadPoolName = "XEngine";
|
||||
startInfo.IdleTimeout = idleTimeout * 1000; // convert to seconds as stated in .ini
|
||||
startInfo.MaxWorkerThreads = maxThreads;
|
||||
startInfo.MinWorkerThreads = minThreads;
|
||||
startInfo.ThreadPriority = threadPriority;;
|
||||
@@ -1494,7 +1493,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
startInfo.StartSuspended = true;
|
||||
|
||||
m_ThreadPool = new SmartThreadPool(startInfo);
|
||||
m_ThreadPool.Name = "XEngine";
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -545,7 +545,7 @@ namespace OpenSim.Services.UserAccountService
|
||||
return account;
|
||||
}
|
||||
|
||||
private void CreateDefaultAppearanceEntries(UUID principalID)
|
||||
protected void CreateDefaultAppearanceEntries(UUID principalID)
|
||||
{
|
||||
m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID);
|
||||
|
||||
|
||||
14
ThirdParty/SmartThreadPool/STPStartInfo.cs
vendored
14
ThirdParty/SmartThreadPool/STPStartInfo.cs
vendored
@@ -32,6 +32,11 @@ namespace Amib.Threading
|
||||
/// </summary>
|
||||
private ThreadPriority _threadPriority;
|
||||
|
||||
/// <summary>
|
||||
/// The thread pool name. Threads will get names depending on this.
|
||||
/// </summary>
|
||||
private string _threadPoolName;
|
||||
|
||||
/// <summary>
|
||||
/// If this field is not null then the performance counters are enabled
|
||||
/// and use the string as the name of the instance.
|
||||
@@ -46,6 +51,7 @@ namespace Amib.Threading
|
||||
_minWorkerThreads = SmartThreadPool.DefaultMinWorkerThreads;
|
||||
_maxWorkerThreads = SmartThreadPool.DefaultMaxWorkerThreads;
|
||||
_threadPriority = SmartThreadPool.DefaultThreadPriority;
|
||||
_threadPoolName = SmartThreadPool.DefaultThreadPoolName;
|
||||
_pcInstanceName = SmartThreadPool.DefaultPerformanceCounterInstanceName;
|
||||
_stackSize = SmartThreadPool.DefaultStackSize;
|
||||
}
|
||||
@@ -56,6 +62,7 @@ namespace Amib.Threading
|
||||
_minWorkerThreads = stpStartInfo._minWorkerThreads;
|
||||
_maxWorkerThreads = stpStartInfo._maxWorkerThreads;
|
||||
_threadPriority = stpStartInfo._threadPriority;
|
||||
_threadPoolName = stpStartInfo._threadPoolName;
|
||||
_pcInstanceName = stpStartInfo._pcInstanceName;
|
||||
_stackSize = stpStartInfo._stackSize;
|
||||
}
|
||||
@@ -84,6 +91,13 @@ namespace Amib.Threading
|
||||
set { _threadPriority = value; }
|
||||
}
|
||||
|
||||
public virtual string ThreadPoolName
|
||||
{
|
||||
get { return _threadPoolName; }
|
||||
set { _threadPoolName = value; }
|
||||
}
|
||||
|
||||
|
||||
public string PerformanceCounterInstanceName
|
||||
{
|
||||
get { return _pcInstanceName; }
|
||||
|
||||
@@ -135,6 +135,11 @@ namespace Amib.Threading
|
||||
/// </summary>
|
||||
public const ThreadPriority DefaultThreadPriority = ThreadPriority.Normal;
|
||||
|
||||
/// <summary>
|
||||
/// The default thread pool name
|
||||
/// </summary>
|
||||
public const string DefaultThreadPoolName = "SmartThreadPool";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Member Variables
|
||||
@@ -143,7 +148,7 @@ namespace Amib.Threading
|
||||
/// Contains the name of this instance of SmartThreadPool.
|
||||
/// Can be changed by the user.
|
||||
/// </summary>
|
||||
private string _name = "SmartThreadPool";
|
||||
private string _name = DefaultThreadPoolName;
|
||||
|
||||
/// <summary>
|
||||
/// Hashtable of all the threads in the thread pool.
|
||||
@@ -307,6 +312,7 @@ namespace Amib.Threading
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
Name = _stpStartInfo.ThreadPoolName;
|
||||
ValidateSTPStartInfo();
|
||||
|
||||
if (null != _stpStartInfo.PerformanceCounterInstanceName)
|
||||
|
||||
Reference in New Issue
Block a user