mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Change more ace_guard to trinity_guard
This commit is contained in:
@@ -1076,14 +1076,14 @@ class ObjectMgr
|
||||
|
||||
time_t GetCreatureRespawnTime(uint32 loguid, uint32 instance)
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_CreatureRespawnTimesMtx, 0);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_CreatureRespawnTimesMtx);
|
||||
return mCreatureRespawnTimes[MAKE_PAIR64(loguid, instance)];
|
||||
}
|
||||
void SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t);
|
||||
void RemoveCreatureRespawnTime(uint32 loguid, uint32 instance);
|
||||
time_t GetGORespawnTime(uint32 loguid, uint32 instance)
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_GORespawnTimesMtx, 0);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_GORespawnTimesMtx);
|
||||
return mGORespawnTimes[MAKE_PAIR64(loguid, instance)];
|
||||
}
|
||||
void SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t);
|
||||
|
||||
@@ -80,8 +80,8 @@ class InstanceSave
|
||||
|
||||
/* online players bound to the instance (perm/solo)
|
||||
does not include the members of the group unless they have permanent saves */
|
||||
void AddPlayer(Player* player) { ACE_GUARD(ACE_Thread_Mutex, guard, _lock); m_playerList.push_back(player); }
|
||||
bool RemovePlayer(Player* player) { ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, _lock, false); m_playerList.remove(player); return UnloadIfEmpty(); }
|
||||
void AddPlayer(Player* player) { TRINITY_GUARD(ACE_Thread_Mutex, _lock); m_playerList.push_back(player); }
|
||||
bool RemovePlayer(Player* player) { TRINITY_GUARD(ACE_Thread_Mutex, _lock); m_playerList.remove(player); return UnloadIfEmpty(); }
|
||||
/* all groups bound to the instance */
|
||||
void AddGroup(Group* group) { m_groupList.push_back(group); }
|
||||
bool RemoveGroup(Group* group) { m_groupList.remove(group); return UnloadIfEmpty(); }
|
||||
|
||||
@@ -322,7 +322,7 @@ void Map::EnsureGridCreated(const GridCoord &p)
|
||||
{
|
||||
if (!getNGrid(p.x_coord, p.y_coord))
|
||||
{
|
||||
ACE_GUARD(ACE_Thread_Mutex, Guard, Lock);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
if (!getNGrid(p.x_coord, p.y_coord))
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "Creating grid[%u, %u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId);
|
||||
@@ -2282,7 +2282,7 @@ bool InstanceMap::AddToMap(Player* player)
|
||||
// Is it needed?
|
||||
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, Lock, false);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
// Check moved to void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
//if (!CanEnter(player))
|
||||
//return false;
|
||||
@@ -2624,7 +2624,7 @@ bool BattlegroundMap::CanEnter(Player* player)
|
||||
bool BattlegroundMap::AddToMap(Player* player)
|
||||
{
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, Lock, false);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
//Check moved to void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
//if (!CanEnter(player))
|
||||
//return false;
|
||||
|
||||
@@ -173,7 +173,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
|
||||
InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty)
|
||||
{
|
||||
// load/create a map
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
|
||||
// make sure we have a valid map id
|
||||
const MapEntry* entry = sMapStore.LookupEntry(GetId());
|
||||
@@ -207,7 +207,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
|
||||
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
|
||||
{
|
||||
// load/create a map
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ Map* MapManager::_createBaseMap(uint32 id)
|
||||
|
||||
if (m == NULL)
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
|
||||
const MapEntry* entry = sMapStore.LookupEntry(id);
|
||||
if (entry && entry->Instanceable())
|
||||
@@ -335,7 +335,7 @@ void MapManager::UnloadAll()
|
||||
|
||||
uint32 MapManager::GetNumInstances()
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, 0);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
|
||||
uint32 ret = 0;
|
||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
@@ -352,7 +352,7 @@ uint32 MapManager::GetNumInstances()
|
||||
|
||||
uint32 MapManager::GetNumPlayersInInstances()
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, 0);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
|
||||
uint32 ret = 0;
|
||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
|
||||
@@ -81,7 +81,7 @@ int MapUpdater::deactivate()
|
||||
|
||||
int MapUpdater::wait()
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_mutex, -1);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_mutex);
|
||||
|
||||
while (pending_requests > 0)
|
||||
m_condition.wait();
|
||||
@@ -91,7 +91,7 @@ int MapUpdater::wait()
|
||||
|
||||
int MapUpdater::schedule_update(Map& map, ACE_UINT32 diff)
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_mutex, -1);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_mutex);
|
||||
|
||||
++pending_requests;
|
||||
|
||||
@@ -113,7 +113,7 @@ bool MapUpdater::activated()
|
||||
|
||||
void MapUpdater::update_finished()
|
||||
{
|
||||
ACE_GUARD(ACE_Thread_Mutex, guard, m_mutex);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_mutex);
|
||||
|
||||
if (pending_requests == 0)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ void WorldLog::outTimestampLog(char const* fmt, ...)
|
||||
{
|
||||
if (LogWorld())
|
||||
{
|
||||
ACE_GUARD(ACE_Thread_Mutex, Guard, Lock);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
ASSERT(i_file);
|
||||
|
||||
Log::outTimestamp(i_file);
|
||||
@@ -89,7 +89,7 @@ void WorldLog::outLog(char const* fmt, ...)
|
||||
{
|
||||
if (LogWorld())
|
||||
{
|
||||
ACE_GUARD(ACE_Thread_Mutex, Guard, Lock);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, Lock);
|
||||
ASSERT(i_file);
|
||||
|
||||
va_list args;
|
||||
|
||||
@@ -109,7 +109,7 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
|
||||
int AddSocket (WorldSocket* sock)
|
||||
{
|
||||
ACE_GUARD_RETURN (ACE_Thread_Mutex, Guard, m_NewSockets_Lock, -1);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_NewSockets_Lock);
|
||||
|
||||
++m_Connections;
|
||||
sock->AddReference();
|
||||
@@ -130,7 +130,7 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||
|
||||
void AddNewSockets()
|
||||
{
|
||||
ACE_GUARD (ACE_Thread_Mutex, Guard, m_NewSockets_Lock);
|
||||
TRINITY_GUARD(ACE_Thread_Mutex, m_NewSockets_Lock);
|
||||
|
||||
if (m_NewSockets.empty())
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user