AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "MapUpdater.h"
Public Member Functions | |
MapUpdater () | |
~MapUpdater ()=default | |
void | schedule_update (Map &map, uint32 diff, uint32 s_diff) |
void | schedule_lfg_update (uint32 diff) |
void | wait () |
void | activate (std::size_t num_threads) |
void | deactivate () |
bool | activated () |
void | update_finished () |
Private Member Functions | |
void | WorkerThread () |
Private Attributes | |
ProducerConsumerQueue< UpdateRequest * > | _queue |
std::vector< std::thread > | _workerThreads |
std::atomic< bool > | _cancelationToken |
std::mutex | _lock |
std::condition_variable | _condition |
std::size_t | pending_requests |
MapUpdater::MapUpdater | ( | ) |
|
default |
void MapUpdater::activate | ( | std::size_t | num_threads | ) |
References _workerThreads, and WorkerThread().
Referenced by MapMgr::Initialize().
bool MapUpdater::activated | ( | ) |
References _workerThreads.
Referenced by MapMgr::UnloadAll(), and MapMgr::Update().
void MapUpdater::deactivate | ( | ) |
References _cancelationToken, _queue, _workerThreads, ProducerConsumerQueue< T >::Cancel(), and wait().
Referenced by MapMgr::UnloadAll().
void MapUpdater::schedule_lfg_update | ( | uint32 | diff | ) |
References _lock, _queue, pending_requests, and ProducerConsumerQueue< T >::Push().
Referenced by MapMgr::Update().
References _lock, _queue, pending_requests, and ProducerConsumerQueue< T >::Push().
Referenced by MapMgr::Update().
void MapUpdater::update_finished | ( | ) |
References _condition, _lock, and pending_requests.
Referenced by MapUpdateRequest::call(), and LFGUpdateRequest::call().
void MapUpdater::wait | ( | ) |
References _condition, _lock, and pending_requests.
Referenced by deactivate(), and MapMgr::Update().
|
private |
References _cancelationToken, _queue, UpdateRequest::call(), CharacterDatabase, LoginDatabase, ProducerConsumerQueue< T >::WaitAndPop(), and WorldDatabase.
Referenced by activate().
|
private |
Referenced by deactivate(), and WorkerThread().
|
private |
Referenced by update_finished(), and wait().
|
private |
Referenced by schedule_lfg_update(), schedule_update(), update_finished(), and wait().
|
private |
Referenced by deactivate(), schedule_lfg_update(), schedule_update(), and WorkerThread().
|
private |
Referenced by activate(), activated(), and deactivate().
|
private |
Referenced by schedule_lfg_update(), schedule_update(), update_finished(), and wait().