* Lock timers when Calling Start() and Stop() when the Thread Context is murky. This affects Mono only.
parent
f0e2fd426b
commit
c605509da3
|
@ -384,7 +384,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
|||
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
|
||||
shutdownTimer.AutoReset = false;
|
||||
shutdownTimer.Elapsed += new ElapsedEventHandler(shutdownTimer_Elapsed);
|
||||
shutdownTimer.Start();
|
||||
lock (shutdownTimer)
|
||||
{
|
||||
shutdownTimer.Start();
|
||||
}
|
||||
|
||||
responseData["success"] = true;
|
||||
}
|
||||
|
|
|
@ -2177,13 +2177,16 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
|||
watchDog.Interval = interval;
|
||||
watchDog.AutoReset = false;
|
||||
watchDog.Enabled = true;
|
||||
watchDog.Start();
|
||||
lock (watchDog)
|
||||
watchDog.Start();
|
||||
|
||||
}
|
||||
|
||||
internal void stopWD()
|
||||
{
|
||||
Rest.Log.DebugFormat("{0} Reset watchdog", MsgId);
|
||||
watchDog.Stop();
|
||||
lock (watchDog)
|
||||
watchDog.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -81,7 +81,8 @@ namespace OpenSim.Client.MXP
|
|||
m_ticker.AutoReset = false;
|
||||
m_ticker.Elapsed += ticker_Elapsed;
|
||||
|
||||
m_ticker.Start();
|
||||
lock (m_ticker)
|
||||
m_ticker.Start();
|
||||
|
||||
m_log.Info("[MXP ClientStack] MXP Enabled and Listening");
|
||||
}
|
||||
|
@ -99,13 +100,17 @@ namespace OpenSim.Client.MXP
|
|||
}
|
||||
|
||||
if (!m_shutdown)
|
||||
m_ticker.Start();
|
||||
{
|
||||
lock (m_ticker)
|
||||
m_ticker.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_shutdown = true;
|
||||
m_ticker.Stop();
|
||||
lock (m_ticker)
|
||||
m_ticker.Stop();
|
||||
}
|
||||
|
||||
public string Name
|
||||
|
|
|
@ -58,7 +58,8 @@ namespace OpenSim.Grid.MessagingServer.Modules
|
|||
m_messageCore = messageCore;
|
||||
|
||||
reconnectTimer.Elapsed += registerWithUserServer;
|
||||
reconnectTimer.Start();
|
||||
lock (reconnectTimer)
|
||||
reconnectTimer.Start();
|
||||
}
|
||||
|
||||
public void Initialise()
|
||||
|
|
|
@ -581,6 +581,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
private void CloseCleanup(bool shutdownCircuit)
|
||||
{
|
||||
|
||||
|
||||
m_scene.RemoveClient(AgentId);
|
||||
|
||||
//m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false));
|
||||
|
@ -592,12 +594,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Shut down timers
|
||||
if (m_clientPingTimer.Enabled) m_clientPingTimer.Stop();
|
||||
if (m_avatarTerseUpdateTimer.Enabled) m_avatarTerseUpdateTimer.Stop();
|
||||
if (m_primTerseUpdateTimer.Enabled) m_primTerseUpdateTimer.Stop();
|
||||
if (m_primFullUpdateTimer.Enabled) m_primFullUpdateTimer.Stop();
|
||||
if (m_textureRequestTimer.Enabled) m_textureRequestTimer.Stop();
|
||||
// Shut down timers. Thread Context of this method is murky. Lock all timers
|
||||
if (m_clientPingTimer.Enabled)
|
||||
lock (m_clientPingTimer)
|
||||
m_clientPingTimer.Stop();
|
||||
if (m_avatarTerseUpdateTimer.Enabled)
|
||||
lock (m_avatarTerseUpdateTimer)
|
||||
m_avatarTerseUpdateTimer.Stop();
|
||||
if (m_primTerseUpdateTimer.Enabled)
|
||||
lock (m_primTerseUpdateTimer)
|
||||
m_primTerseUpdateTimer.Stop();
|
||||
if (m_primFullUpdateTimer.Enabled)
|
||||
lock (m_primFullUpdateTimer)
|
||||
m_primFullUpdateTimer.Stop();
|
||||
if (m_textureRequestTimer.Enabled)
|
||||
lock (m_textureRequestTimer)
|
||||
m_textureRequestTimer.Stop();
|
||||
|
||||
// This is just to give the client a reasonable chance of
|
||||
// flushing out all it's packets. There should probably
|
||||
|
@ -676,12 +688,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
public void Stop()
|
||||
{
|
||||
// Shut down timers
|
||||
if (m_clientPingTimer.Enabled) m_clientPingTimer.Stop();
|
||||
if (m_avatarTerseUpdateTimer.Enabled) m_avatarTerseUpdateTimer.Stop();
|
||||
if (m_primTerseUpdateTimer.Enabled) m_primTerseUpdateTimer.Stop();
|
||||
if (m_primFullUpdateTimer.Enabled) m_primFullUpdateTimer.Stop();
|
||||
if (m_textureRequestTimer.Enabled) m_textureRequestTimer.Stop();
|
||||
// Shut down timers. Thread Context is Murky, lock all timers!
|
||||
if (m_clientPingTimer.Enabled)
|
||||
lock (m_clientPingTimer)
|
||||
m_clientPingTimer.Stop();
|
||||
|
||||
if (m_avatarTerseUpdateTimer.Enabled)
|
||||
lock (m_avatarTerseUpdateTimer)
|
||||
m_avatarTerseUpdateTimer.Stop();
|
||||
|
||||
if (m_primTerseUpdateTimer.Enabled)
|
||||
lock (m_primTerseUpdateTimer)
|
||||
m_primTerseUpdateTimer.Stop();
|
||||
|
||||
if (m_primFullUpdateTimer.Enabled)
|
||||
lock (m_primFullUpdateTimer)
|
||||
m_primFullUpdateTimer.Stop();
|
||||
|
||||
if (m_textureRequestTimer.Enabled)
|
||||
lock (m_textureRequestTimer)
|
||||
m_textureRequestTimer.Stop();
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
|
@ -2907,7 +2933,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
else if (m_avatarTerseUpdates.Count == 1)
|
||||
{
|
||||
m_avatarTerseUpdateTimer.Start();
|
||||
lock (m_avatarTerseUpdateTimer)
|
||||
m_avatarTerseUpdateTimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2957,7 +2984,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
OutPacket(terse, ThrottleOutPacketType.Task);
|
||||
|
||||
if (m_avatarTerseUpdates.Count == 0)
|
||||
m_avatarTerseUpdateTimer.Stop();
|
||||
{
|
||||
lock (m_avatarTerseUpdateTimer)
|
||||
m_avatarTerseUpdateTimer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3138,7 +3168,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
if (m_imageManager.ProcessImageQueue(m_textureSendLimit,
|
||||
m_textureDataLimit))
|
||||
{
|
||||
m_textureRequestTimer.Start();
|
||||
lock(m_textureRequestTimer)
|
||||
m_textureRequestTimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3149,7 +3180,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled)
|
||||
{
|
||||
m_primFullUpdateTimer.Stop();
|
||||
lock (m_primFullUpdateTimer)
|
||||
m_primFullUpdateTimer.Stop();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -3196,7 +3228,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
|
||||
|
||||
if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled)
|
||||
m_primFullUpdateTimer.Stop();
|
||||
lock (m_primFullUpdateTimer)
|
||||
m_primFullUpdateTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3234,7 +3267,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
if (m_primTerseUpdates.Count == 0)
|
||||
{
|
||||
m_primTerseUpdateTimer.Stop();
|
||||
lock (m_primTerseUpdateTimer)
|
||||
m_primTerseUpdateTimer.Stop();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -3284,7 +3318,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
|
||||
|
||||
if (m_primTerseUpdates.Count == 0)
|
||||
m_primTerseUpdateTimer.Stop();
|
||||
lock (m_primTerseUpdateTimer)
|
||||
m_primTerseUpdateTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6586,7 +6621,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
if (m_imageManager != null)
|
||||
{
|
||||
m_imageManager.EnqueueReq(args);
|
||||
m_textureRequestTimer.Start();
|
||||
lock (m_textureRequestTimer)
|
||||
m_textureRequestTimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,7 +160,10 @@ namespace Flotsam.RegionModules.AssetCache
|
|||
m_CachCleanTimer.AutoReset = true;
|
||||
m_CachCleanTimer.Elapsed += CleanupExpiredFiles;
|
||||
m_CachCleanTimer.Enabled = true;
|
||||
m_CachCleanTimer.Start();
|
||||
lock (m_CachCleanTimer)
|
||||
{
|
||||
m_CachCleanTimer.Start();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -78,7 +78,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
bool permissionToDelete)
|
||||
{
|
||||
if (Enabled)
|
||||
m_inventoryTicker.Stop();
|
||||
lock (m_inventoryTicker)
|
||||
m_inventoryTicker.Stop();
|
||||
|
||||
lock (m_inventoryDeletes)
|
||||
{
|
||||
|
@ -93,7 +94,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
if (Enabled)
|
||||
m_inventoryTicker.Start();
|
||||
lock (m_inventoryTicker)
|
||||
m_inventoryTicker.Start();
|
||||
|
||||
// Visually remove it, even if it isnt really gone yet. This means that if we crash before the object
|
||||
// has gone to inventory, it will reappear in the region again on restart instead of being lost.
|
||||
|
|
|
@ -3762,6 +3762,8 @@ if (m_shape != null) {
|
|||
lPos = AbsolutePosition;
|
||||
}
|
||||
|
||||
// Causes this thread to dig into the Client Thread Data.
|
||||
// Remember your locking here!
|
||||
remoteClient.SendPrimTerseUpdate(m_regionHandle,
|
||||
(ushort)(m_parentGroup.GetTimeDilation() *
|
||||
(float)ushort.MaxValue), LocalId, lPos,
|
||||
|
|
Loading…
Reference in New Issue