mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[9245] Remove CellLock class and all cell-level thread locking.
* It was wasting CPU power as cell-level locking is not needed. * Future multithreading will be on map-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.
This commit is contained in:
parent
39b7636094
commit
0ff9250de2
19 changed files with 104 additions and 209 deletions
|
|
@ -551,8 +551,7 @@ void Creature::DoFleeToGetAssistance()
|
|||
|
||||
TypeContainerVisitor<MaNGOS::CreatureLastSearcher<MaNGOS::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
|
||||
SetNoSearchAssistance(true);
|
||||
UpdateSpeed(MOVE_RUN, false);
|
||||
|
|
@ -1524,8 +1523,7 @@ void Creature::CallAssistance()
|
|||
|
||||
TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
|
||||
if (!assistList.empty())
|
||||
|
|
@ -1558,8 +1556,7 @@ void Creature::CallForHelp(float fRadius)
|
|||
|
||||
TypeContainerVisitor<MaNGOS::CreatureWorker<MaNGOS::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *GetMap(), *this, fRadius);
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, fRadius);
|
||||
}
|
||||
|
||||
bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /*= true*/) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue