aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Archiver
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-11-25 23:56:32 +0000
committerJustin Clark-Casey (justincc)2014-11-25 23:56:32 +0000
commit86367d7219b3bd52f63045b2b17bcbde328844ed (patch)
tree789227d95cb152a437481e741b55d86dfeba9f74 /OpenSim/Region/CoreModules/World/Archiver
parentFix ghosts copy of SimulatorFeatureModule to enable logging. (diff)
downloadopensim-SC-86367d7219b3bd52f63045b2b17bcbde328844ed.zip
opensim-SC-86367d7219b3bd52f63045b2b17bcbde328844ed.tar.gz
opensim-SC-86367d7219b3bd52f63045b2b17bcbde328844ed.tar.bz2
opensim-SC-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 'OpenSim/Region/CoreModules/World/Archiver')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs4
3 files changed, 5 insertions, 5 deletions
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 {