From c605509da3a690d4050c48418111d7f29f7be9b4 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Wed, 9 Sep 2009 16:20:19 -0400 Subject: * Lock timers when Calling Start() and Stop() when the Thread Context is murky. This affects Mono only. --- OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 5 ++++- OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim/ApplicationPlugins') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 67ba016..7e0a4ba 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -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; } diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 59431bb..4e03e67 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -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(); } /// -- cgit v1.1