diff options
author | Justin Clark-Casey (justincc) | 2014-11-25 23:56:32 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:56:32 +0000 |
commit | 86367d7219b3bd52f63045b2b17bcbde328844ed (patch) | |
tree | 789227d95cb152a437481e741b55d86dfeba9f74 /OpenSim/Region | |
parent | Fix ghosts copy of SimulatorFeatureModule to enable logging. (diff) | |
download | opensim-SC_OLD-86367d7219b3bd52f63045b2b17bcbde328844ed.zip opensim-SC_OLD-86367d7219b3bd52f63045b2b17bcbde328844ed.tar.gz opensim-SC_OLD-86367d7219b3bd52f63045b2b17bcbde328844ed.tar.bz2 opensim-SC_OLD-86367d7219b3bd52f63045b2b17bcbde328844ed.tar.xz |
refactor: Move methods to start a monitored thread, start work in its own thread and run work in the jobengine from Watchdog to a WorkManager class.
This is to achieve a clean separation of concerns - the watchdog is an inappropriate place for work management.
Also adds a WorkManager.RunInThreadPool() class which feeds through to Util.FireAndForget.
Also switches around the name and obj arguments to the new RunInThread() and RunJob() methods so that the callback obj comes after the callback as seen in the SDK and elsewhere
Diffstat (limited to '')
22 files changed, 42 insertions, 42 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0f61faf..3be411a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -339,7 +339,7 @@ namespace OpenSim | |||
339 | 339 | ||
340 | IConfig startupConfig = Config.Configs["Startup"]; | 340 | IConfig startupConfig = Config.Configs["Startup"]; |
341 | if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true)) | 341 | if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true)) |
342 | Watchdog.JobEngine.Start(); | 342 | WorkManager.JobEngine.Start(); |
343 | 343 | ||
344 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; | 344 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; |
345 | SceneManager.OnRestartSim += HandleRestartRegion; | 345 | SceneManager.OnRestartSim += HandleRestartRegion; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 87192a0..84ca4bb 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
207 | 207 | ||
208 | for (uint i = 0; i < 2; i++) | 208 | for (uint i = 0; i < 2; i++) |
209 | { | 209 | { |
210 | m_workerThreads[i] = Watchdog.StartThread(DoInventoryRequests, | 210 | m_workerThreads[i] = WorkManager.StartThread(DoInventoryRequests, |
211 | String.Format("InventoryWorkerThread{0}", i), | 211 | String.Format("InventoryWorkerThread{0}", i), |
212 | ThreadPriority.Normal, | 212 | ThreadPriority.Normal, |
213 | false, | 213 | false, |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/IncomingPacketAsyncHandlingEngine.cs b/OpenSim/Region/ClientStack/Linden/UDP/IncomingPacketAsyncHandlingEngine.cs index 874ddae..6f40b24 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/IncomingPacketAsyncHandlingEngine.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/IncomingPacketAsyncHandlingEngine.cs | |||
@@ -132,7 +132,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
132 | 132 | ||
133 | StatsManager.RegisterStat(m_requestsWaitingStat); | 133 | StatsManager.RegisterStat(m_requestsWaitingStat); |
134 | 134 | ||
135 | Watchdog.StartThread( | 135 | WorkManager.StartThread( |
136 | ProcessRequests, | 136 | ProcessRequests, |
137 | string.Format("Incoming Packet Async Handling Engine Thread ({0})", m_udpServer.Scene.Name), | 137 | string.Format("Incoming Packet Async Handling Engine Thread ({0})", m_udpServer.Scene.Name), |
138 | ThreadPriority.Normal, | 138 | ThreadPriority.Normal, |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index d8cf7a5..2f97516 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -483,7 +483,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
483 | base.StartInbound(m_recvBufferSize, m_asyncPacketHandling); | 483 | base.StartInbound(m_recvBufferSize, m_asyncPacketHandling); |
484 | 484 | ||
485 | // This thread will process the packets received that are placed on the packetInbox | 485 | // This thread will process the packets received that are placed on the packetInbox |
486 | Watchdog.StartThread( | 486 | WorkManager.StartThread( |
487 | IncomingPacketHandler, | 487 | IncomingPacketHandler, |
488 | string.Format("Incoming Packets ({0})", Scene.Name), | 488 | string.Format("Incoming Packets ({0})", Scene.Name), |
489 | ThreadPriority.Normal, | 489 | ThreadPriority.Normal, |
@@ -499,7 +499,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
499 | 499 | ||
500 | base.StartOutbound(); | 500 | base.StartOutbound(); |
501 | 501 | ||
502 | Watchdog.StartThread( | 502 | WorkManager.StartThread( |
503 | OutgoingPacketHandler, | 503 | OutgoingPacketHandler, |
504 | string.Format("Outgoing Packets ({0})", Scene.Name), | 504 | string.Format("Outgoing Packets ({0})", Scene.Name), |
505 | ThreadPriority.Normal, | 505 | ThreadPriority.Normal, |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs b/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs index 2ec1733..1e915c3 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs | |||
@@ -124,7 +124,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
124 | 124 | ||
125 | StatsManager.RegisterStat(m_oqreRequestsWaitingStat); | 125 | StatsManager.RegisterStat(m_oqreRequestsWaitingStat); |
126 | 126 | ||
127 | Watchdog.StartThread( | 127 | WorkManager.StartThread( |
128 | ProcessRequests, | 128 | ProcessRequests, |
129 | String.Format("OutgoingQueueRefillEngineThread ({0})", m_udpServer.Scene.Name), | 129 | String.Format("OutgoingQueueRefillEngineThread ({0})", m_udpServer.Scene.Name), |
130 | ThreadPriority.Normal, | 130 | ThreadPriority.Normal, |
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 5eca025..fe9a17d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -964,11 +964,11 @@ namespace OpenSim.Region.CoreModules.Asset | |||
964 | case "assets": | 964 | case "assets": |
965 | con.Output("Ensuring assets are cached for all scenes."); | 965 | con.Output("Ensuring assets are cached for all scenes."); |
966 | 966 | ||
967 | Watchdog.RunInThread(delegate | 967 | WorkManager.RunInThread(delegate |
968 | { | 968 | { |
969 | int assetReferenceTotal = TouchAllSceneAssets(true); | 969 | int assetReferenceTotal = TouchAllSceneAssets(true); |
970 | con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal); | 970 | con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal); |
971 | }, "TouchAllSceneAssets", null); | 971 | }, null, "TouchAllSceneAssets"); |
972 | 972 | ||
973 | break; | 973 | break; |
974 | 974 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 9fb8aa5..6dab227 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -431,7 +431,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
431 | m_scene.UserAccountService, m_scene.RegionInfo.ScopeID, | 431 | m_scene.UserAccountService, m_scene.RegionInfo.ScopeID, |
432 | options, ReceivedAllAssets); | 432 | options, ReceivedAllAssets); |
433 | 433 | ||
434 | Watchdog.RunInThread(o => ar.Execute(), string.Format("AssetsRequest ({0})", m_scene.Name), null); | 434 | WorkManager.RunInThread(o => ar.Execute(), null, string.Format("AssetsRequest ({0})", m_scene.Name)); |
435 | } | 435 | } |
436 | else | 436 | else |
437 | { | 437 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs index ce6cdc9..f62e7f4 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs | |||
@@ -134,7 +134,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
134 | 134 | ||
135 | StatsManager.RegisterStat(m_requestsWaitingStat); | 135 | StatsManager.RegisterStat(m_requestsWaitingStat); |
136 | 136 | ||
137 | Watchdog.StartThread( | 137 | WorkManager.StartThread( |
138 | ProcessRequests, | 138 | ProcessRequests, |
139 | string.Format("HG Incoming Scene Object Engine Thread ({0})", Name), | 139 | string.Format("HG Incoming Scene Object Engine Thread ({0})", Name), |
140 | ThreadPriority.Normal, | 140 | ThreadPriority.Normal, |
diff --git a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs index a70261e..3abacbd 100644 --- a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
67 | m_timer.Elapsed += ProcessQueue; | 67 | m_timer.Elapsed += ProcessQueue; |
68 | m_timer.Start(); | 68 | m_timer.Start(); |
69 | 69 | ||
70 | //Watchdog.StartThread( | 70 | //WorkManager.StartThread( |
71 | // ProcessQueue, | 71 | // ProcessQueue, |
72 | // "GridServiceRequestThread", | 72 | // "GridServiceRequestThread", |
73 | // ThreadPriority.BelowNormal, | 73 | // ThreadPriority.BelowNormal, |
diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index d7ea906..af3700b 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
658 | public void Process() | 658 | public void Process() |
659 | { | 659 | { |
660 | _finished = false; | 660 | _finished = false; |
661 | Watchdog.StartThread(SendRequest, "HttpRequestThread", ThreadPriority.BelowNormal, true, false); | 661 | WorkManager.StartThread(SendRequest, "HttpRequestThread", ThreadPriority.BelowNormal, true, false); |
662 | } | 662 | } |
663 | 663 | ||
664 | /* | 664 | /* |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 470ef02..cbe0e37 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -184,12 +184,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
184 | // Protect ourselves against the caller subsequently modifying the items list | 184 | // Protect ourselves against the caller subsequently modifying the items list |
185 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | 185 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); |
186 | 186 | ||
187 | Watchdog.RunInThread(delegate | 187 | WorkManager.RunInThread(delegate |
188 | { | 188 | { |
189 | foreach (InventoryItemBase item in items) | 189 | foreach (InventoryItemBase item in items) |
190 | if (!string.IsNullOrEmpty(item.CreatorData)) | 190 | if (!string.IsNullOrEmpty(item.CreatorData)) |
191 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 191 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
192 | }, string.Format("GetFolderContent (user {0}, folder {1})", userID, folderID), null); | 192 | }, null, string.Format("GetFolderContent (user {0}, folder {1})", userID, folderID)); |
193 | } | 193 | } |
194 | 194 | ||
195 | return invCol; | 195 | return invCol; |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 3e0c9f3..9c6706f 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
372 | // Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so | 372 | // Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so |
373 | // that users can enter the scene. If we allow the scripts to start in the loop above | 373 | // that users can enter the scene. If we allow the scripts to start in the loop above |
374 | // then they significantly increase the time until the OAR finishes loading. | 374 | // then they significantly increase the time until the OAR finishes loading. |
375 | Watchdog.RunInThread(o => | 375 | WorkManager.RunInThread(o => |
376 | { | 376 | { |
377 | Thread.Sleep(15000); | 377 | Thread.Sleep(15000); |
378 | m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); | 378 | m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); |
@@ -387,7 +387,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
387 | 387 | ||
388 | sceneContext.SceneObjects.Clear(); | 388 | sceneContext.SceneObjects.Clear(); |
389 | } | 389 | } |
390 | }, string.Format("ReadArchiveStartScripts (request {0})", m_requestId), null); | 390 | }, null, string.Format("ReadArchiveStartScripts (request {0})", m_requestId)); |
391 | 391 | ||
392 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); | 392 | m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); |
393 | 393 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 924b999..b7d7c26 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -200,7 +200,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
200 | m_rootScene.AssetService, m_rootScene.UserAccountService, | 200 | m_rootScene.AssetService, m_rootScene.UserAccountService, |
201 | m_rootScene.RegionInfo.ScopeID, options, ReceivedAllAssets); | 201 | m_rootScene.RegionInfo.ScopeID, options, ReceivedAllAssets); |
202 | 202 | ||
203 | Watchdog.RunInThread(o => ar.Execute(), "Archive Assets Request", null); | 203 | WorkManager.RunInThread(o => ar.Execute(), null, "Archive Assets Request"); |
204 | 204 | ||
205 | // CloseArchive() will be called from ReceivedAllAssets() | 205 | // CloseArchive() will be called from ReceivedAllAssets() |
206 | } | 206 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index ec39bc0..4d99a6e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
227 | finally | 227 | finally |
228 | { | 228 | { |
229 | if (timedOut) | 229 | if (timedOut) |
230 | Watchdog.RunInThread(PerformAssetsRequestCallback, "Archive Assets Request Callback", true); | 230 | WorkManager.RunInThread(PerformAssetsRequestCallback, true, "Archive Assets Request Callback"); |
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
@@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
296 | 296 | ||
297 | // We want to stop using the asset cache thread asap | 297 | // We want to stop using the asset cache thread asap |
298 | // as we now need to do the work of producing the rest of the archive | 298 | // as we now need to do the work of producing the rest of the archive |
299 | Watchdog.RunInThread(PerformAssetsRequestCallback, "Archive Assets Request Callback", false); | 299 | WorkManager.RunInThread(PerformAssetsRequestCallback, false, "Archive Assets Request Callback"); |
300 | } | 300 | } |
301 | else | 301 | else |
302 | { | 302 | { |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 78fbefe..767f75f 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -381,7 +381,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
381 | 381 | ||
382 | // m_log.Debug("[WORLD MAP]: Starting remote MapItem request thread"); | 382 | // m_log.Debug("[WORLD MAP]: Starting remote MapItem request thread"); |
383 | 383 | ||
384 | Watchdog.StartThread( | 384 | WorkManager.StartThread( |
385 | process, | 385 | process, |
386 | string.Format("MapItemRequestThread ({0})", m_scene.RegionInfo.RegionName), | 386 | string.Format("MapItemRequestThread ({0})", m_scene.RegionInfo.RegionName), |
387 | ThreadPriority.BelowNormal, | 387 | ThreadPriority.BelowNormal, |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 171f066..f7c12d6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1428,7 +1428,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | m_heartbeatThread | 1430 | m_heartbeatThread |
1431 | = Watchdog.StartThread( | 1431 | = WorkManager.StartThread( |
1432 | Heartbeat, string.Format("Heartbeat-({0})", RegionInfo.RegionName.Replace(" ", "_")), ThreadPriority.Normal, false, false); | 1432 | Heartbeat, string.Format("Heartbeat-({0})", RegionInfo.RegionName.Replace(" ", "_")), ThreadPriority.Normal, false, false); |
1433 | 1433 | ||
1434 | StartScripts(); | 1434 | StartScripts(); |
@@ -1469,7 +1469,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1469 | // alarms for scenes with many objects. | 1469 | // alarms for scenes with many objects. |
1470 | Update(1); | 1470 | Update(1); |
1471 | 1471 | ||
1472 | Watchdog.StartThread( | 1472 | WorkManager.StartThread( |
1473 | Maintenance, string.Format("Maintenance ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, true); | 1473 | Maintenance, string.Format("Maintenance ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, true); |
1474 | 1474 | ||
1475 | Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true; | 1475 | Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true; |
@@ -1568,10 +1568,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1568 | tmpMS = Util.EnvironmentTickCount(); | 1568 | tmpMS = Util.EnvironmentTickCount(); |
1569 | m_cleaningTemps = true; | 1569 | m_cleaningTemps = true; |
1570 | 1570 | ||
1571 | Watchdog.RunInThread( | 1571 | WorkManager.RunInThread( |
1572 | delegate { CleanTempObjects(); m_cleaningTemps = false; }, | 1572 | delegate { CleanTempObjects(); m_cleaningTemps = false; }, |
1573 | string.Format("CleanTempObjects ({0})", Name), | 1573 | null, |
1574 | null); | 1574 | string.Format("CleanTempObjects ({0})", Name)); |
1575 | 1575 | ||
1576 | tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS); | 1576 | tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS); |
1577 | } | 1577 | } |
@@ -1843,7 +1843,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1843 | if (!m_backingup) | 1843 | if (!m_backingup) |
1844 | { | 1844 | { |
1845 | m_backingup = true; | 1845 | m_backingup = true; |
1846 | Watchdog.RunInThread(o => Backup(false), string.Format("BackupWaitCallback ({0})", Name), null); | 1846 | WorkManager.RunInThread(o => Backup(false), null, string.Format("BackupWaitCallback ({0})", Name)); |
1847 | } | 1847 | } |
1848 | } | 1848 | } |
1849 | 1849 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 757ec43..5a35aff 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1228,11 +1228,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1228 | // viewers without (e.g. v1 viewers) will not, so we still need to make this call. | 1228 | // viewers without (e.g. v1 viewers) will not, so we still need to make this call. |
1229 | if (Scene.AttachmentsModule != null) | 1229 | if (Scene.AttachmentsModule != null) |
1230 | { | 1230 | { |
1231 | Watchdog.RunJob( | 1231 | WorkManager.RunJob( |
1232 | "RezAttachments", | 1232 | "RezAttachments", |
1233 | o => Scene.AttachmentsModule.RezAttachments(this), | 1233 | o => Scene.AttachmentsModule.RezAttachments(this), |
1234 | string.Format("Rez attachments for {0} in {1}", Name, Scene.Name), | 1234 | null, |
1235 | null); | 1235 | string.Format("Rez attachments for {0} in {1}", Name, Scene.Name)); |
1236 | } | 1236 | } |
1237 | } | 1237 | } |
1238 | else | 1238 | else |
@@ -1254,11 +1254,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1254 | 1254 | ||
1255 | if (attachments.Count > 0) | 1255 | if (attachments.Count > 0) |
1256 | { | 1256 | { |
1257 | Watchdog.RunJob( | 1257 | WorkManager.RunJob( |
1258 | "StartAttachmentScripts", | 1258 | "StartAttachmentScripts", |
1259 | o => RestartAttachmentScripts(attachments), | 1259 | o => RestartAttachmentScripts(attachments), |
1260 | string.Format("Start attachment scripts for {0} in {1}", Name, Scene.Name), | ||
1261 | null, | 1260 | null, |
1261 | string.Format("Start attachment scripts for {0} in {1}", Name, Scene.Name), | ||
1262 | true); | 1262 | true); |
1263 | } | 1263 | } |
1264 | } | 1264 | } |
@@ -1815,11 +1815,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1815 | // XXX: If we force an update after activity has completed, then multiple attachments do appear correctly on a destination region | 1815 | // XXX: If we force an update after activity has completed, then multiple attachments do appear correctly on a destination region |
1816 | // If we do it a little bit earlier (e.g. when converting the child to a root agent) then this does not work. | 1816 | // If we do it a little bit earlier (e.g. when converting the child to a root agent) then this does not work. |
1817 | // This may be due to viewer code or it may be something we're not doing properly simulator side. | 1817 | // This may be due to viewer code or it may be something we're not doing properly simulator side. |
1818 | Watchdog.RunJob( | 1818 | WorkManager.RunJob( |
1819 | "ScheduleAttachmentsForFullUpdate", | 1819 | "ScheduleAttachmentsForFullUpdate", |
1820 | o => ScheduleAttachmentsForFullUpdate(), | 1820 | o => ScheduleAttachmentsForFullUpdate(), |
1821 | string.Format("Schedule attachments for full update for {0} in {1}", Name, Scene.Name), | ||
1822 | null, | 1821 | null, |
1822 | string.Format("Schedule attachments for full update for {0} in {1}", Name, Scene.Name), | ||
1823 | true); | 1823 | true); |
1824 | 1824 | ||
1825 | // m_log.DebugFormat( | 1825 | // m_log.DebugFormat( |
@@ -3375,7 +3375,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3375 | SentInitialDataToClient = true; | 3375 | SentInitialDataToClient = true; |
3376 | 3376 | ||
3377 | // Send all scene object to the new client | 3377 | // Send all scene object to the new client |
3378 | Watchdog.RunJob("SendInitialDataToClient", delegate | 3378 | WorkManager.RunJob("SendInitialDataToClient", delegate |
3379 | { | 3379 | { |
3380 | // m_log.DebugFormat( | 3380 | // m_log.DebugFormat( |
3381 | // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", | 3381 | // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", |
@@ -3393,7 +3393,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3393 | if (e != null && e is SceneObjectGroup) | 3393 | if (e != null && e is SceneObjectGroup) |
3394 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); | 3394 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); |
3395 | } | 3395 | } |
3396 | }, string.Format("SendInitialDataToClient ({0} in {1})", Name, Scene.Name),null, false, true); | 3396 | }, null, string.Format("SendInitialDataToClient ({0} in {1})", Name, Scene.Name), false, true); |
3397 | } | 3397 | } |
3398 | 3398 | ||
3399 | /// <summary> | 3399 | /// <summary> |
@@ -4057,11 +4057,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
4057 | // We don't need to worry about a race condition as the job to later start the scripts is also | 4057 | // We don't need to worry about a race condition as the job to later start the scripts is also |
4058 | // JobEngine scheduled and so will always occur after this task. | 4058 | // JobEngine scheduled and so will always occur after this task. |
4059 | // XXX: This will not be true if JobEngine ever gets more than one thread. | 4059 | // XXX: This will not be true if JobEngine ever gets more than one thread. |
4060 | Watchdog.RunJob( | 4060 | WorkManager.RunJob( |
4061 | "CopyAttachments", | 4061 | "CopyAttachments", |
4062 | o => Scene.AttachmentsModule.CopyAttachments(cAgent, this), | 4062 | o => Scene.AttachmentsModule.CopyAttachments(cAgent, this), |
4063 | string.Format("Copy attachments for {0} entering {1}", Name, Scene.Name), | ||
4064 | null, | 4063 | null, |
4064 | string.Format("Copy attachments for {0} entering {1}", Name, Scene.Name), | ||
4065 | true); | 4065 | true); |
4066 | } | 4066 | } |
4067 | 4067 | ||
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index e1aaf18..6fe86b2 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
71 | m_client = client; | 71 | m_client = client; |
72 | m_scene = scene; | 72 | m_scene = scene; |
73 | 73 | ||
74 | Watchdog.StartThread(InternalLoop, "IRCClientView", ThreadPriority.Normal, false, true); | 74 | WorkManager.StartThread(InternalLoop, "IRCClientView", ThreadPriority.Normal, false, true); |
75 | } | 75 | } |
76 | 76 | ||
77 | private void SendServerCommand(string command) | 77 | private void SendServerCommand(string command) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs index 9d27386..a1682d2 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
58 | 58 | ||
59 | m_listener.Start(50); | 59 | m_listener.Start(50); |
60 | 60 | ||
61 | Watchdog.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false, true); | 61 | WorkManager.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false, true); |
62 | m_baseScene = baseScene; | 62 | m_baseScene = baseScene; |
63 | } | 63 | } |
64 | 64 | ||
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs index bdd07e0..6985371 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs | |||
@@ -359,7 +359,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
359 | 359 | ||
360 | m_log.InfoFormat("[IRC-Connector-{0}]: Connected to {1}:{2}", idn, m_server, m_port); | 360 | m_log.InfoFormat("[IRC-Connector-{0}]: Connected to {1}:{2}", idn, m_server, m_port); |
361 | 361 | ||
362 | Watchdog.StartThread(ListenerRun, "IRCConnectionListenerThread", ThreadPriority.Normal, true, false); | 362 | WorkManager.StartThread(ListenerRun, "IRCConnectionListenerThread", ThreadPriority.Normal, true, false); |
363 | 363 | ||
364 | // This is the message order recommended by RFC 2812 | 364 | // This is the message order recommended by RFC 2812 |
365 | if (m_password != null) | 365 | if (m_password != null) |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 46a13ab..0f79a10 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -293,7 +293,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
293 | { | 293 | { |
294 | // The physics simulation should happen independently of the heartbeat loop | 294 | // The physics simulation should happen independently of the heartbeat loop |
295 | m_physicsThread | 295 | m_physicsThread |
296 | = Watchdog.StartThread( | 296 | = WorkManager.StartThread( |
297 | BulletSPluginPhysicsThread, | 297 | BulletSPluginPhysicsThread, |
298 | string.Format("{0} ({1})", BulletEngineName, RegionName), | 298 | string.Format("{0} ({1})", BulletEngineName, RegionName), |
299 | ThreadPriority.Normal, | 299 | ThreadPriority.Normal, |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 40a05cf..036cb5d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -182,7 +182,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
182 | { | 182 | { |
183 | // Start the thread that will be doing the work | 183 | // Start the thread that will be doing the work |
184 | cmdHandlerThread | 184 | cmdHandlerThread |
185 | = Watchdog.StartThread( | 185 | = WorkManager.StartThread( |
186 | CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true); | 186 | CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true); |
187 | } | 187 | } |
188 | } | 188 | } |