aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorubit2012-09-01 03:12:10 +0200
committerubit2012-09-01 03:12:10 +0200
commitc93b2db9f2b4a8084777d909272a4cc4d748bd9c (patch)
tree7d249645c092cc871f03440645a40bbcc9ba8d4a
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parent try to reduce potencial recursive locking (diff)
downloadopensim-SC_OLD-c93b2db9f2b4a8084777d909272a4cc4d748bd9c.zip
opensim-SC_OLD-c93b2db9f2b4a8084777d909272a4cc4d748bd9c.tar.gz
opensim-SC_OLD-c93b2db9f2b4a8084777d909272a4cc4d748bd9c.tar.bz2
opensim-SC_OLD-c93b2db9f2b4a8084777d909272a4cc4d748bd9c.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs77
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs60
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
4 files changed, 111 insertions, 33 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index a353909..dac3306 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -927,6 +927,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
927 packetInbox.EnqueueHigh(new IncomingPacket((LLClientView)client, packet)); 927 packetInbox.EnqueueHigh(new IncomingPacket((LLClientView)client, packet));
928 else 928 else
929 packetInbox.EnqueueLow(new IncomingPacket((LLClientView)client, packet)); 929 packetInbox.EnqueueLow(new IncomingPacket((LLClientView)client, packet));
930// packetInbox.Enqueue(new IncomingPacket((LLClientView)client, packet));
930 } 931 }
931 932
932 #region BinaryStats 933 #region BinaryStats
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 51dcb67..8bc81ae 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -86,7 +86,10 @@ namespace OpenSim.Region.CoreModules.World.Land
86 /// <value> 86 /// <value>
87 /// Land objects keyed by local id 87 /// Land objects keyed by local id
88 /// </value> 88 /// </value>
89 private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); 89// private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
90
91 //ubit: removed the readonly so i can move it around
92 private Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
90 93
91 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; 94 private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
92 95
@@ -242,15 +245,19 @@ namespace OpenSim.Region.CoreModules.World.Land
242 { 245 {
243 LandData newData = data.Copy(); 246 LandData newData = data.Copy();
244 newData.LocalID = local_id; 247 newData.LocalID = local_id;
248 ILandObject landobj = null;
245 249
246 lock (m_landList) 250 lock (m_landList)
247 { 251 {
248 if (m_landList.ContainsKey(local_id)) 252 if (m_landList.ContainsKey(local_id))
249 { 253 {
250 m_landList[local_id].LandData = newData; 254 m_landList[local_id].LandData = newData;
251 m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]); 255 landobj = m_landList[local_id];
256// m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]);
252 } 257 }
253 } 258 }
259 if(landobj != null)
260 m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, landobj);
254 } 261 }
255 262
256 public bool AllowedForcefulBans 263 public bool AllowedForcefulBans
@@ -280,14 +287,14 @@ namespace OpenSim.Region.CoreModules.World.Land
280 protected ILandObject CreateDefaultParcel() 287 protected ILandObject CreateDefaultParcel()
281 { 288 {
282 m_log.DebugFormat( 289 m_log.DebugFormat(
283 "[LAND MANAGEMENT MODULE]: Creating default parcel for region {0}", m_scene.RegionInfo.RegionName); 290 "[LAND MANAGEMENT MODULE]: Creating default parcel for region {0}", m_scene.RegionInfo.RegionName);
284 291
285 ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); 292 ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene);
286 fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); 293 fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
287 fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; 294 fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
288 fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); 295 fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch();
289 296
290 return AddLandObject(fullSimParcel); 297 return AddLandObject(fullSimParcel);
291 } 298 }
292 299
293 public List<ILandObject> AllParcels() 300 public List<ILandObject> AllParcels()
@@ -617,21 +624,28 @@ namespace OpenSim.Region.CoreModules.World.Land
617 /// </summary> 624 /// </summary>
618 public void Clear(bool setupDefaultParcel) 625 public void Clear(bool setupDefaultParcel)
619 { 626 {
627 Dictionary<int, ILandObject> landworkList;
628 // move to work pointer since we are deleting it all
620 lock (m_landList) 629 lock (m_landList)
621 { 630 {
622 foreach (ILandObject lo in m_landList.Values) 631 landworkList = m_landList;
623 { 632 m_landList = new Dictionary<int, ILandObject>();
624 //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); 633 }
625 m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID);
626 }
627 634
628 m_landList.Clear(); 635 // this 2 methods have locks (now)
636 ResetSimLandObjects();
629 637
630 ResetSimLandObjects(); 638 if (setupDefaultParcel)
639 CreateDefaultParcel();
631 640
632 if (setupDefaultParcel) 641 // fire outside events unlocked
633 CreateDefaultParcel(); 642 foreach (ILandObject lo in landworkList.Values)
643 {
644 //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID);
645 m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID);
634 } 646 }
647 landworkList.Clear();
648
635 } 649 }
636 650
637 private void performFinalLandJoin(ILandObject master, ILandObject slave) 651 private void performFinalLandJoin(ILandObject master, ILandObject slave)
@@ -1324,20 +1338,30 @@ namespace OpenSim.Region.CoreModules.World.Land
1324 1338
1325 public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) 1339 public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data)
1326 { 1340 {
1341 Dictionary<int, ILandObject> landworkList;
1342 // move to work pointer since we are deleting it all
1343 lock (m_landList)
1344 {
1345 landworkList = m_landList;
1346 m_landList = new Dictionary<int, ILandObject>();
1347 }
1348
1349 //Remove all the land objects in the sim and then process our new data
1350 foreach (int n in landworkList.Keys)
1351 {
1352 m_scene.EventManager.TriggerLandObjectRemoved(landworkList[n].LandData.GlobalID);
1353 }
1354 landworkList.Clear();
1355
1327 lock (m_landList) 1356 lock (m_landList)
1328 { 1357 {
1329 //Remove all the land objects in the sim and then process our new data
1330 foreach (int n in m_landList.Keys)
1331 {
1332 m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID);
1333 }
1334 m_landIDList.Initialize(); 1358 m_landIDList.Initialize();
1335 m_landList.Clear(); 1359 m_landList.Clear();
1360 }
1336 1361
1337 for (int i = 0; i < data.Count; i++) 1362 for (int i = 0; i < data.Count; i++)
1338 { 1363 {
1339 IncomingLandObjectFromStorage(data[i]); 1364 IncomingLandObjectFromStorage(data[i]);
1340 }
1341 } 1365 }
1342 } 1366 }
1343 1367
@@ -1366,7 +1390,8 @@ namespace OpenSim.Region.CoreModules.World.Land
1366 1390
1367 public void EventManagerOnNoLandDataFromStorage() 1391 public void EventManagerOnNoLandDataFromStorage()
1368 { 1392 {
1369 lock (m_landList) 1393 // called methods already have locks
1394// lock (m_landList)
1370 { 1395 {
1371 ResetSimLandObjects(); 1396 ResetSimLandObjects();
1372 CreateDefaultParcel(); 1397 CreateDefaultParcel();
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 431b903..e970543 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -422,6 +422,20 @@ namespace OpenSim.Region.Framework.Scenes
422 ); 422 );
423 } 423 }
424 424
425 private class DescendentsRequestData
426 {
427 public IClientAPI RemoteClient;
428 public UUID FolderID;
429 public UUID OwnerID;
430 public bool FetchFolders;
431 public bool FetchItems;
432 public int SortOrder;
433 }
434
435 private Queue<DescendentsRequestData> m_descendentsRequestQueue = new Queue<DescendentsRequestData>();
436 private Object m_descendentsRequestLock = new Object();
437 private bool m_descendentsRequestProcessing = false;
438
425 /// <summary> 439 /// <summary>
426 /// Tell the client about the various child items and folders contained in the requested folder. 440 /// Tell the client about the various child items and folders contained in the requested folder.
427 /// </summary> 441 /// </summary>
@@ -458,17 +472,38 @@ namespace OpenSim.Region.Framework.Scenes
458 } 472 }
459 } 473 }
460 474
461 // We're going to send the reply async, because there may be 475 lock (m_descendentsRequestLock)
462 // an enormous quantity of packets -- basically the entire inventory! 476 {
463 // We don't want to block the client thread while all that is happening. 477 if (!m_descendentsRequestProcessing)
464 SendInventoryDelegate d = SendInventoryAsync; 478 {
465 d.BeginInvoke(remoteClient, folderID, ownerID, fetchFolders, fetchItems, sortOrder, SendInventoryComplete, d); 479 m_descendentsRequestProcessing = true;
480
481 // We're going to send the reply async, because there may be
482 // an enormous quantity of packets -- basically the entire inventory!
483 // We don't want to block the client thread while all that is happening.
484 SendInventoryDelegate d = SendInventoryAsync;
485 d.BeginInvoke(remoteClient, folderID, ownerID, fetchFolders, fetchItems, sortOrder, SendInventoryComplete, d);
486
487 return;
488 }
489
490 DescendentsRequestData req = new DescendentsRequestData();
491 req.RemoteClient = remoteClient;
492 req.FolderID = folderID;
493 req.OwnerID = ownerID;
494 req.FetchFolders = fetchFolders;
495 req.FetchItems = fetchItems;
496 req.SortOrder = sortOrder;
497
498 m_descendentsRequestQueue.Enqueue(req);
499 }
466 } 500 }
467 501
468 delegate void SendInventoryDelegate(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); 502 delegate void SendInventoryDelegate(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
469 503
470 void SendInventoryAsync(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) 504 void SendInventoryAsync(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
471 { 505 {
506 Thread.Sleep(20);
472 SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems); 507 SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems);
473 } 508 }
474 509
@@ -476,6 +511,21 @@ namespace OpenSim.Region.Framework.Scenes
476 { 511 {
477 SendInventoryDelegate d = (SendInventoryDelegate)iar.AsyncState; 512 SendInventoryDelegate d = (SendInventoryDelegate)iar.AsyncState;
478 d.EndInvoke(iar); 513 d.EndInvoke(iar);
514
515 lock (m_descendentsRequestLock)
516 {
517 if (m_descendentsRequestQueue.Count > 0)
518 {
519 DescendentsRequestData req = m_descendentsRequestQueue.Dequeue();
520
521 d = SendInventoryAsync;
522 d.BeginInvoke(req.RemoteClient, req.FolderID, req.OwnerID, req.FetchFolders, req.FetchItems, req.SortOrder, SendInventoryComplete, d);
523
524 return;
525 }
526
527 m_descendentsRequestProcessing = false;
528 }
479 } 529 }
480 530
481 /// <summary> 531 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 207d062..d5e611c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5475,7 +5475,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5475 // for completion and should LSL_Key ever be implemented 5475 // for completion and should LSL_Key ever be implemented
5476 // as it's own struct 5476 // as it's own struct
5477 else if (!(src.Data[index] is LSL_String || 5477 else if (!(src.Data[index] is LSL_String ||
5478 src.Data[index] is LSL_Key)) 5478 src.Data[index] is LSL_Key ||
5479 src.Data[index] is String))
5479 { 5480 {
5480 return ""; 5481 return "";
5481 } 5482 }
@@ -12818,7 +12819,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12818 public void llCollisionSprite(string impact_sprite) 12819 public void llCollisionSprite(string impact_sprite)
12819 { 12820 {
12820 m_host.AddScriptLPS(1); 12821 m_host.AddScriptLPS(1);
12821 NotImplemented("llCollisionSprite"); 12822 // Viewer 2.0 broke this and it's likely LL has no intention
12823 // of fixing it. Therefore, letting this be a NOP seems appropriate.
12822 } 12824 }
12823 12825
12824 public void llGodLikeRezObject(string inventory, LSL_Vector pos) 12826 public void llGodLikeRezObject(string inventory, LSL_Vector pos)