diff options
author | Melanie | 2009-10-07 01:44:36 +0100 |
---|---|---|
committer | Melanie | 2009-10-07 01:44:36 +0100 |
commit | 9618c196c274fefda4437eff6d25c7a12e7a3ee1 (patch) | |
tree | b860a6f957e3d0b2504ca2ec6802b1a211e4a3de /OpenSim/Region/CoreModules | |
parent | Commented noisy debugging about packet splitting (diff) | |
download | opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.zip opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.gz opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.bz2 opensim-SC_OLD-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.xz |
Revert "Merging in diva's locking fixes"
This reverts commit 832cc685138b2244529f10b54b373c34adb4a633.
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 51 insertions, 62 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 4abad81..fc7d63a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -442,46 +442,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
442 | 442 | ||
443 | private ScenePresence GetRootPresenceFromAgentID(UUID AgentID) | 443 | private ScenePresence GetRootPresenceFromAgentID(UUID AgentID) |
444 | { | 444 | { |
445 | List<Scene> scenes = null; | ||
446 | lock (m_scenes) | ||
447 | scenes = new List<Scene>(m_scenes.Values); | ||
448 | |||
449 | ScenePresence returnAgent = null; | 445 | ScenePresence returnAgent = null; |
450 | ScenePresence queryagent = null; | 446 | lock (m_scenes) |
451 | foreach (Scene scene in scenes) | ||
452 | { | 447 | { |
453 | queryagent = scene.GetScenePresence(AgentID); | 448 | ScenePresence queryagent = null; |
454 | if (queryagent != null) | 449 | foreach (Scene scene in m_scenes.Values) |
455 | { | 450 | { |
456 | if (!queryagent.IsChildAgent) | 451 | queryagent = scene.GetScenePresence(AgentID); |
452 | if (queryagent != null) | ||
457 | { | 453 | { |
458 | returnAgent = queryagent; | 454 | if (!queryagent.IsChildAgent) |
459 | break; | 455 | { |
456 | returnAgent = queryagent; | ||
457 | break; | ||
458 | } | ||
460 | } | 459 | } |
461 | } | 460 | } |
462 | } | 461 | } |
463 | |||
464 | return returnAgent; | 462 | return returnAgent; |
465 | } | 463 | } |
466 | 464 | ||
467 | private ScenePresence GetAnyPresenceFromAgentID(UUID AgentID) | 465 | private ScenePresence GetAnyPresenceFromAgentID(UUID AgentID) |
468 | { | 466 | { |
469 | List<Scene> scenes = null; | ||
470 | lock (m_scenes) | ||
471 | scenes = new List<Scene>(m_scenes.Values); | ||
472 | |||
473 | ScenePresence returnAgent = null; | 467 | ScenePresence returnAgent = null; |
474 | ScenePresence queryagent = null; | 468 | lock (m_scenes) |
475 | foreach (Scene scene in m_scenes.Values) | ||
476 | { | 469 | { |
477 | queryagent = scene.GetScenePresence(AgentID); | 470 | ScenePresence queryagent = null; |
478 | if (queryagent != null) | 471 | foreach (Scene scene in m_scenes.Values) |
479 | { | 472 | { |
480 | returnAgent = queryagent; | 473 | queryagent = scene.GetScenePresence(AgentID); |
481 | break; | 474 | if (queryagent != null) |
475 | { | ||
476 | returnAgent = queryagent; | ||
477 | break; | ||
478 | } | ||
482 | } | 479 | } |
483 | } | 480 | } |
484 | |||
485 | return returnAgent; | 481 | return returnAgent; |
486 | } | 482 | } |
487 | 483 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index 42dd7ff..ad05bab 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | |||
@@ -290,14 +290,13 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
290 | 290 | ||
291 | // get the agent. This should work every time, as we just got a packet from it | 291 | // get the agent. This should work every time, as we just got a packet from it |
292 | ScenePresence agent = null; | 292 | ScenePresence agent = null; |
293 | List<Scene> scenes = null; | ||
294 | lock (m_Scenes) | 293 | lock (m_Scenes) |
295 | scenes = new List<Scene>(m_Scenes); | ||
296 | |||
297 | foreach (Scene scene in scenes) | ||
298 | { | 294 | { |
299 | agent = scene.GetScenePresence(agentID); | 295 | foreach (Scene scene in m_Scenes) |
300 | if (agent != null) break; | 296 | { |
297 | agent = scene.GetScenePresence(agentID); | ||
298 | if (agent != null) break; | ||
299 | } | ||
301 | } | 300 | } |
302 | 301 | ||
303 | // just to be paranoid... | 302 | // just to be paranoid... |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index e6e0483..d9a021f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -111,17 +111,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
111 | 111 | ||
112 | private Scene FindClientScene(UUID agentId) | 112 | private Scene FindClientScene(UUID agentId) |
113 | { | 113 | { |
114 | List<Scene> scenes = null; | ||
115 | lock (m_Scenelist) | 114 | lock (m_Scenelist) |
116 | scenes = new List<Scene>(m_Scenelist); | ||
117 | |||
118 | foreach (Scene scene in scenes) | ||
119 | { | 115 | { |
120 | ScenePresence presence = scene.GetScenePresence(agentId); | 116 | foreach (Scene scene in m_Scenelist) |
121 | if (presence != null) | ||
122 | { | 117 | { |
123 | if (!presence.IsChildAgent) | 118 | ScenePresence presence = scene.GetScenePresence(agentId); |
124 | return scene; | 119 | if (presence != null) |
120 | { | ||
121 | if (!presence.IsChildAgent) | ||
122 | return scene; | ||
123 | } | ||
125 | } | 124 | } |
126 | } | 125 | } |
127 | return null; | 126 | return null; |
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index f9f01fe..83f004d 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -198,20 +198,19 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
198 | 198 | ||
199 | private SceneObjectPart findPrim(UUID objectID, out string ObjectRegionName) | 199 | private SceneObjectPart findPrim(UUID objectID, out string ObjectRegionName) |
200 | { | 200 | { |
201 | List<Scene> scenes = null; | ||
202 | lock (m_Scenes) | 201 | lock (m_Scenes) |
203 | scenes = new List<Scene>(m_Scenes.Values); | ||
204 | |||
205 | foreach (Scene s in scenes) | ||
206 | { | 202 | { |
207 | SceneObjectPart part = s.GetSceneObjectPart(objectID); | 203 | foreach (Scene s in m_Scenes.Values) |
208 | if (part != null) | ||
209 | { | 204 | { |
210 | ObjectRegionName = s.RegionInfo.RegionName; | 205 | SceneObjectPart part = s.GetSceneObjectPart(objectID); |
211 | uint localX = (s.RegionInfo.RegionLocX * (int)Constants.RegionSize); | 206 | if (part != null) |
212 | uint localY = (s.RegionInfo.RegionLocY * (int)Constants.RegionSize); | 207 | { |
213 | ObjectRegionName = ObjectRegionName + " (" + localX + ", " + localY + ")"; | 208 | ObjectRegionName = s.RegionInfo.RegionName; |
214 | return part; | 209 | uint localX = (s.RegionInfo.RegionLocX * (int)Constants.RegionSize); |
210 | uint localY = (s.RegionInfo.RegionLocY * (int)Constants.RegionSize); | ||
211 | ObjectRegionName = ObjectRegionName + " (" + localX + ", " + localY + ")"; | ||
212 | return part; | ||
213 | } | ||
215 | } | 214 | } |
216 | } | 215 | } |
217 | ObjectRegionName = string.Empty; | 216 | ObjectRegionName = string.Empty; |
@@ -364,7 +363,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
364 | public Email GetNextEmail(UUID objectID, string sender, string subject) | 363 | public Email GetNextEmail(UUID objectID, string sender, string subject) |
365 | { | 364 | { |
366 | List<Email> queue = null; | 365 | List<Email> queue = null; |
367 | List<UUID> removal = new List<UUID>(); | ||
368 | 366 | ||
369 | lock (m_LastGetEmailCall) | 367 | lock (m_LastGetEmailCall) |
370 | { | 368 | { |
@@ -377,6 +375,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
377 | 375 | ||
378 | // Hopefully this isn't too time consuming. If it is, we can always push it into a worker thread. | 376 | // Hopefully this isn't too time consuming. If it is, we can always push it into a worker thread. |
379 | DateTime now = DateTime.Now; | 377 | DateTime now = DateTime.Now; |
378 | List<UUID> removal = new List<UUID>(); | ||
380 | foreach (UUID uuid in m_LastGetEmailCall.Keys) | 379 | foreach (UUID uuid in m_LastGetEmailCall.Keys) |
381 | { | 380 | { |
382 | if ((now - m_LastGetEmailCall[uuid]) > m_QueueTimeout) | 381 | if ((now - m_LastGetEmailCall[uuid]) > m_QueueTimeout) |
@@ -384,15 +383,15 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
384 | removal.Add(uuid); | 383 | removal.Add(uuid); |
385 | } | 384 | } |
386 | } | 385 | } |
387 | } | ||
388 | 386 | ||
389 | foreach (UUID remove in removal) | 387 | foreach (UUID remove in removal) |
390 | { | 388 | { |
391 | lock (m_LastGetEmailCall) | ||
392 | m_LastGetEmailCall.Remove(remove); | 389 | m_LastGetEmailCall.Remove(remove); |
393 | 390 | lock (m_MailQueues) | |
394 | lock (m_MailQueues) | 391 | { |
395 | m_MailQueues.Remove(remove); | 392 | m_MailQueues.Remove(remove); |
393 | } | ||
394 | } | ||
396 | } | 395 | } |
397 | 396 | ||
398 | lock (m_MailQueues) | 397 | lock (m_MailQueues) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 0fed1bd..d2b5cb1 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -187,16 +187,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
187 | LandData newData = data.Copy(); | 187 | LandData newData = data.Copy(); |
188 | newData.LocalID = local_id; | 188 | newData.LocalID = local_id; |
189 | 189 | ||
190 | ILandObject land = null; | ||
191 | lock (m_landList) | 190 | lock (m_landList) |
192 | { | 191 | { |
193 | if (m_landList.ContainsKey(local_id)) | 192 | if (m_landList.ContainsKey(local_id)) |
194 | { | 193 | { |
195 | m_landList[local_id].LandData = newData; | 194 | m_landList[local_id].LandData = newData; |
196 | land = m_landList[local_id]; | 195 | m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]); |
197 | } | 196 | } |
198 | } | 197 | } |
199 | m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, land); | ||
200 | } | 198 | } |
201 | 199 | ||
202 | public bool AllowedForcefulBans | 200 | public bool AllowedForcefulBans |
@@ -506,7 +504,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
506 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> | 504 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> |
507 | public void removeLandObject(int local_id) | 505 | public void removeLandObject(int local_id) |
508 | { | 506 | { |
509 | UUID id = UUID.Zero; | ||
510 | lock (m_landList) | 507 | lock (m_landList) |
511 | { | 508 | { |
512 | for (int x = 0; x < 64; x++) | 509 | for (int x = 0; x < 64; x++) |
@@ -523,10 +520,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
523 | } | 520 | } |
524 | } | 521 | } |
525 | 522 | ||
526 | id = m_landList[local_id].LandData.GlobalID; | 523 | m_scene.EventManager.TriggerLandObjectRemoved(m_landList[local_id].LandData.GlobalID); |
527 | m_landList.Remove(local_id); | 524 | m_landList.Remove(local_id); |
528 | } | 525 | } |
529 | m_scene.EventManager.TriggerLandObjectRemoved(id); | ||
530 | } | 526 | } |
531 | 527 | ||
532 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 528 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |