* 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
This commit is contained in:
XTZGZoReX
2010-01-23 22:24:41 +01:00
parent fe07518baf
commit 9f00ca3eb8
24 changed files with 110 additions and 212 deletions
@@ -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())
{