aboutsummaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorXTZGZoReX <none@none>2010-01-23 22:24:41 +0100
committerXTZGZoReX <none@none>2010-01-23 22:24:41 +0100
commit9f00ca3eb884399479009ae5d5a1224c047d0650 (patch)
tree1ba2681bb2ca1c7e4ad9b4334f1b725d222b44ed /src/scripts
parentfe07518bafe3f0a52630ce09ee5742453f2f6801 (diff)
* Remove CellLock class and all cell-level thread locking.
** It was wasting CPU power as cell-level locking is not needed. ** Our multithreading is on map-level, not cell-level. ** CellLock was just a 'proxy' between Cell and CellPair and in some cases carried redundant data. ** Some minor cleanup in Cell::Visit/Map::Visit. --HG-- branch : trunk
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp3
-rw-r--r--src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp5
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp5
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp9
-rw-r--r--src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp3
-rw-r--r--src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp12
6 files changed, 14 insertions, 23 deletions
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
index 12014ffdbe3..6e680a16f19 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp
@@ -530,8 +530,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
}
for (std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
index 578d8af0c3a..d85af40496e 100644
--- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
+++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp
@@ -341,10 +341,11 @@ struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI
AllOrbsInGrid check;
Trinity::GameObjectListSearcher<AllOrbsInGrid> searcher(me, orbList, check);
TypeContainerVisitor<Trinity::GameObjectListSearcher<AllOrbsInGrid>, GridTypeMapContainer> visitor(searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, visitor, *(m_creature->GetMap()));
+
if (orbList.empty())
return;
+
uint8 i = 0;
for (std::list<GameObject*>::iterator itr = orbList.begin(); itr != orbList.end(); ++itr, ++i){
Orb[i] = pInstance ? pInstance->instance->GetGameObject(pInstance->GetData64((*itr)->GetGUID())) : NULL;
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp
index 40bff5f552f..825059efd67 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp
@@ -193,9 +193,8 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap()));
- cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap()));
+ cell.Visit(p, world_unit_searcher, *(m_creature->GetMap()));
+ cell.Visit(p, grid_unit_searcher, *(m_creature->GetMap()));
}
//dealdamege
for (std::list<Unit*>::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp
index aef4b337a97..905fd45d420 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp
@@ -239,8 +239,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
}
//error_log("Eggs %d at middle", templist.size());
@@ -274,8 +273,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
}
for (std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i)
{
@@ -507,8 +505,7 @@ struct TRINITY_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
}
//error_log("Eggs %d at %d", templist.size(), side);
diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp
index 1c234716fe4..a694ba8d346 100644
--- a/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp
+++ b/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp
@@ -161,8 +161,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap()));
+ cell.Visit(pair, cSearcher, *(m_creature->GetMap()));
}
if (!templist.size())
diff --git a/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp b/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp
index ea73232072b..c6d77c0f966 100644
--- a/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp
+++ b/src/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp
@@ -945,9 +945,8 @@ void hyjalAI::HideNearPos(float x, float y)
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
// Get Creatures
- cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
if (!creatures.empty())
{
@@ -968,8 +967,7 @@ void hyjalAI::RespawnNearPos(float x, float y)
Trinity::RespawnDo u_do;
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(m_creature, u_do);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
- CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, obj_worker, *m_creature->GetMap());
+ cell.Visit(p, obj_worker, *m_creature->GetMap());
}
void hyjalAI::WaypointReached(uint32 i)
{
@@ -1005,8 +1003,7 @@ void hyjalAI::WaypointReached(uint32 i)
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
if (!creatures.empty())
{
@@ -1047,8 +1044,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
- CellLock<GridReadGuard> cell_lock(cell, pair);
- cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
+ cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
if (!creatures.empty())
{