mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
* Changed the misc. methods calling ThreadPool.UnsafeQueueUserWorkItem() to Util.FireAndForget()
* Changed Util.FireAndForget() to use any of five different methods set with async_call_method in the [Startup] section of OpenSim.ini. Look at the example config for possible values
This commit is contained in:
@@ -90,10 +90,17 @@ namespace OpenSim
|
||||
appender.File = fileName;
|
||||
appender.ActivateOptions();
|
||||
}
|
||||
m_log.InfoFormat("[LOGGING] Logging started to file {0}", appender.File);
|
||||
m_log.InfoFormat("[LOGGING]: Logging started to file {0}", appender.File);
|
||||
}
|
||||
}
|
||||
|
||||
string asyncCallMethodStr = startupConfig.GetString("async_call_method", String.Empty);
|
||||
FireAndForgetMethod asyncCallMethod;
|
||||
if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod))
|
||||
Util.FireAndForgetMethod = asyncCallMethod;
|
||||
}
|
||||
|
||||
m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -791,7 +791,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <param name="map">heightmap</param>
|
||||
public virtual void SendLayerData(float[] map)
|
||||
{
|
||||
ThreadPool.UnsafeQueueUserWorkItem(DoSendLayerData, map);
|
||||
Util.FireAndForget(DoSendLayerData, map);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -931,7 +931,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <param name="windSpeeds">16x16 array of wind speeds</param>
|
||||
public virtual void SendWindData(Vector2[] windSpeeds)
|
||||
{
|
||||
ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds);
|
||||
Util.FireAndForget(DoSendWindData, windSpeeds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -940,7 +940,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <param name="windSpeeds">16x16 array of cloud densities</param>
|
||||
public virtual void SendCloudData(float[] cloudDensity)
|
||||
{
|
||||
ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(DoSendCloudData), (object)cloudDensity);
|
||||
Util.FireAndForget(DoSendCloudData, cloudDensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -302,12 +302,8 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
|
||||
}
|
||||
|
||||
ThreadPool.UnsafeQueueUserWorkItem(
|
||||
delegate
|
||||
{
|
||||
WriteFileCache(filename, asset);
|
||||
}, null
|
||||
);
|
||||
Util.FireAndForget(
|
||||
delegate { WriteFileCache(filename, asset); });
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -1095,7 +1095,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
// The reason is so we don't cause the thread to freeze waiting
|
||||
// for the 1 second it costs to start a thread manually.
|
||||
if (!threadrunning)
|
||||
ThreadPool.UnsafeQueueUserWorkItem(this.StartThread, null);
|
||||
Util.FireAndForget(this.StartThread);
|
||||
|
||||
lock (m_rootAgents)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user