Added lock around World.Update to prevent multiple updates occuring simultaneously (it happened!)

0.1-prestable
Adam Frisby 2007-04-22 18:00:01 +00:00
parent 869b39c451
commit 6103e06a34
1 changed files with 37 additions and 32 deletions

View File

@ -41,6 +41,7 @@ namespace OpenSim.world
private string m_regionName;
private InventoryCache _inventoryCache;
private AssetCache _assetCache;
private int updateLock;
/// <summary>
/// Creates a new World class, and a region to go with it.
@ -52,6 +53,7 @@ namespace OpenSim.world
{
try
{
updateLock = 0;
m_clientThreads = clientThreads;
m_regionHandle = regionHandle;
m_regionName = regionName;
@ -182,6 +184,8 @@ namespace OpenSim.world
/// Performs per-frame updates on the world, this should be the central world loop
/// </summary>
public void Update()
{
lock (updateLock)
{
try
{
@ -227,6 +231,7 @@ namespace OpenSim.world
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: Update() - Failed with exception " + e.ToString());
}
}
}
/// <summary>
/// Loads a new storage subsystem from a named library