summaryrefslogtreecommitdiffstats
path: root/src/DeadlockDetect.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/DeadlockDetect.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/DeadlockDetect.cpp b/src/DeadlockDetect.cpp
index 3f47589d8..fc426d529 100644
--- a/src/DeadlockDetect.cpp
+++ b/src/DeadlockDetect.cpp
@@ -103,11 +103,10 @@ void cDeadlockDetect::Execute(void)
{
// Check the world ages:
cRoot::Get()->ForEachWorld([=](cWorld & a_World)
- {
- CheckWorldAge(a_World.GetName(), a_World.GetWorldAge());
- return false;
- }
- );
+ {
+ CheckWorldAge(a_World.GetName(), a_World.GetWorldAge());
+ return false;
+ });
std::this_thread::sleep_for(std::chrono::milliseconds(CYCLE_MILLISECONDS));
} // while (should run)
@@ -117,7 +116,7 @@ void cDeadlockDetect::Execute(void)
-void cDeadlockDetect::SetWorldAge(const AString & a_WorldName, Int64 a_Age)
+void cDeadlockDetect::SetWorldAge(const AString & a_WorldName, const cTickTimeLong a_Age)
{
m_WorldAges[a_WorldName].m_Age = a_Age;
m_WorldAges[a_WorldName].m_NumCyclesSame = 0;
@@ -127,7 +126,7 @@ void cDeadlockDetect::SetWorldAge(const AString & a_WorldName, Int64 a_Age)
-void cDeadlockDetect::CheckWorldAge(const AString & a_WorldName, Int64 a_Age)
+void cDeadlockDetect::CheckWorldAge(const AString & a_WorldName, const cTickTimeLong a_Age)
{
WorldAges::iterator itr = m_WorldAges.find(a_WorldName);
if (itr == m_WorldAges.end())
@@ -157,14 +156,14 @@ void cDeadlockDetect::CheckWorldAge(const AString & a_WorldName, Int64 a_Age)
-void cDeadlockDetect::DeadlockDetected(const AString & a_WorldName, Int64 a_WorldAge)
+void cDeadlockDetect::DeadlockDetected(const AString & a_WorldName, const cTickTimeLong a_WorldAge)
{
LOGERROR("Deadlock detected: world %s has been stuck at age %lld. Aborting the server.",
- a_WorldName.c_str(), static_cast<long long>(a_WorldAge)
+ a_WorldName.c_str(), static_cast<long long>(a_WorldAge.count())
);
ListTrackedCSs();
ASSERT(!"Deadlock detected");
- abort();
+ std::abort();
}
@@ -182,7 +181,3 @@ void cDeadlockDetect::ListTrackedCSs(void)
);
}
}
-
-
-
-