take the Monitor.wait out of the locks

LSLKeyTest
UbitUmarov 2015-11-22 07:55:49 +00:00
parent b80cbf5060
commit 5c3f88b64d
1 changed files with 17 additions and 16 deletions

View File

@ -200,10 +200,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
m_archiverModule.ArchiveRegion(archiveWriteStream, requestId);
//AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer;
//while (assetServer.HasWaitingRequests())
// assetServer.ProcessNextRequest();
Monitor.Wait(this, 60000);
// assetServer.ProcessNextRequest();
}
Monitor.Wait(this, 60000);
Assert.That(m_lastRequestId, Is.EqualTo(requestId));
@ -401,9 +401,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
{
m_scene.EventManager.OnOarFileLoaded += LoadCompleted;
m_archiverModule.DearchiveRegion(archiveReadStream);
Monitor.Wait(this, 60000);
}
Monitor.Wait(this, 60000);
Assert.That(m_lastErrorMessage, Is.Null);
TestLoadedRegion(part1, soundItemName, soundData);
@ -451,8 +451,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
{
m_scene.EventManager.OnOarFileLoaded += LoadCompleted;
m_archiverModule.DearchiveRegion(archiveReadStream);
Monitor.Wait(this, 60000);
}
Monitor.Wait(this, 60000);
Assert.That(m_lastErrorMessage, Is.Null);
@ -501,11 +501,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
lock (this)
{
m_archiverModule.ArchiveRegion(
archiveWriteStream, requestId, new Dictionary<string, Object>() { { "wipe-owners", Boolean.TrueString } });
Monitor.Wait(this, 60000);
archiveWriteStream, requestId, new Dictionary<string, Object>() { { "wipe-owners", Boolean.TrueString } });
}
Monitor.Wait(this, 60000);
Assert.That(m_lastRequestId, Is.EqualTo(requestId));
byte[] archive = archiveWriteStream.ToArray();
@ -535,6 +534,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
scene2.EventManager.OnOarFileLoaded += LoadCompleted;
archiverModule.DearchiveRegion(archiveReadStream);
}
Monitor.Wait(this, 60000);
Assert.That(m_lastErrorMessage, Is.Null);
@ -600,6 +600,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
m_scene.EventManager.OnOarFileLoaded += LoadCompleted;
m_archiverModule.DearchiveRegion(oarStream);
}
Monitor.Wait(this, 60000);
ILandObject rLo = m_scene.LandChannel.GetLandObject(16, 16);
LandData rLd = rLo.LandData;
@ -671,8 +672,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
{
m_scene.EventManager.OnOarFileLoaded += LoadCompleted;
m_archiverModule.DearchiveRegion(archiveReadStream);
Monitor.Wait(this, 60000);
}
Monitor.Wait(this, 60000);
Assert.That(m_lastErrorMessage, Is.Null);
RegionSettings loadedRs = m_scene.RegionInfo.RegionSettings;
@ -742,13 +743,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
// Write out this scene
scene.EventManager.OnOarFileSaved += SaveCompleted;
lock (this)
{
scene.EventManager.OnOarFileSaved += SaveCompleted;
m_archiverModule.ArchiveRegion(archiveWriteStream);
Monitor.Wait(this, 60000);
}
Monitor.Wait(this, 60000);
}
{
@ -765,8 +766,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
Dictionary<string, object> archiveOptions = new Dictionary<string, object>();
archiveOptions.Add("merge", null);
m_archiverModule.DearchiveRegion(archiveReadStream, Guid.Empty, archiveOptions);
Monitor.Wait(this, 60000);
}
Monitor.Wait(this, 60000);
SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name);
Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge");
@ -839,7 +840,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
// Save OAR
MemoryStream archiveWriteStream = new MemoryStream();
m_scene.EventManager.OnOarFileSaved += SaveCompleted;
Guid requestId = new Guid("00000000-0000-0000-0000-808080808080");
@ -848,9 +848,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
lock (this)
{
m_scene.EventManager.OnOarFileSaved += SaveCompleted;
m_archiverModule.ArchiveRegion(archiveWriteStream, requestId, options);
Monitor.Wait(this, 60000);
}
Monitor.Wait(this, 60000);
// Check that the OAR contains the expected data
@ -1023,8 +1024,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
Dictionary<string, object> archiveOptions = new Dictionary<string, object>();
archiveOptions.Add("merge", null);
m_archiverModule.DearchiveRegion(archiveReadStream, Guid.Empty, archiveOptions);
Monitor.Wait(this, 60000);
}
Monitor.Wait(this, 60000);
Assert.That(m_lastErrorMessage, Is.Null);