From 8fbac08fb57475312f6da4dec452d787eab34047 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Fri, 18 Jan 2008 20:46:53 +0000 Subject: [PATCH] Added a mutex lock on loadAllLandObjectsFromStorage so maybe just MAYBE we can get rid of that annoying startup crash... --- OpenSim/Region/Environment/Scenes/Scene.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3a0e1b9466..8374dcf195 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -896,17 +896,21 @@ namespace OpenSim.Region.Environment.Scenes #region Load Land + private static readonly object _loadAllLAndMutex = new object(); public void loadAllLandObjectsFromStorage() { - MainLog.Instance.Verbose("SCENE", "Loading land objects from storage"); - List landData = m_storageManager.DataStore.LoadLandObjects(RegionInfo.RegionID); - if (landData.Count == 0) + lock (_loadAllLAndMutex) { - m_LandManager.NoLandDataFromStorage(); - } - else - { - m_LandManager.IncomingLandObjectsFromStorage(landData); + MainLog.Instance.Verbose("SCENE", "Loading land objects from storage"); + List landData = m_storageManager.DataStore.LoadLandObjects(RegionInfo.RegionID); + if (landData.Count == 0) + { + m_LandManager.NoLandDataFromStorage(); + } + else + { + m_LandManager.IncomingLandObjectsFromStorage(landData); + } } }