Added mutex instead of lock for update

0.1-prestable
Adam Frisby 2007-04-22 18:51:03 +00:00
parent 2194b74473
commit d82466ec82
1 changed files with 41 additions and 41 deletions

View File

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.IO;
using System.Threading;
using OpenSim.Physics.Manager;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Assets;
@ -41,7 +42,7 @@ namespace OpenSim.world
private string m_regionName;
private InventoryCache _inventoryCache;
private AssetCache _assetCache;
private Object updateLock;
private Mutex updateLock;
/// <summary>
/// Creates a new World class, and a region to go with it.
@ -53,7 +54,7 @@ namespace OpenSim.world
{
try
{
updateLock = null;
updateLock = new Mutex(false);
m_clientThreads = clientThreads;
m_regionHandle = regionHandle;
m_regionName = regionName;
@ -185,8 +186,7 @@ namespace OpenSim.world
/// </summary>
public void Update()
{
lock (updateLock)
{
updateLock.WaitOne();
try
{
if (this.phyScene.IsThreaded)
@ -230,7 +230,7 @@ namespace OpenSim.world
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: Update() - Failed with exception " + e.ToString());
}
}
updateLock.ReleaseMutex();
}
/// <summary>