summaryrefslogtreecommitdiffstats
path: root/src/DeadlockDetect.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-20 19:59:40 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-20 19:59:40 +0200
commitbde99d684e0bb51adaa053a240abe61cf4af07fb (patch)
treead1111d21ee606dd3cd60439189a92b1b51e2dea /src/DeadlockDetect.cpp
parentMigrated random generators to std::random (diff)
downloadcuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar
cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.gz
cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.bz2
cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.lz
cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.xz
cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.zst
cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.zip
Diffstat (limited to '')
-rw-r--r--src/DeadlockDetect.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/DeadlockDetect.cpp b/src/DeadlockDetect.cpp
index 7f703416c..81a328af8 100644
--- a/src/DeadlockDetect.cpp
+++ b/src/DeadlockDetect.cpp
@@ -13,8 +13,8 @@
-/// Number of milliseconds per cycle
-const int CYCLE_MILLISECONDS = 100;
+/** Number of milliseconds per cycle */
+#define CYCLE_MILLISECONDS 100
@@ -87,7 +87,7 @@ void cDeadlockDetect::Execute(void)
} Checker(this);
cRoot::Get()->ForEachWorld(Checker);
- cSleep::MilliSleep(CYCLE_MILLISECONDS);
+ std::this_thread::sleep_for(std::chrono::milliseconds(CYCLE_MILLISECONDS));
} // while (should run)
}
@@ -119,7 +119,7 @@ void cDeadlockDetect::CheckWorldAge(const AString & a_WorldName, Int64 a_Age)
if (WorldAge.m_Age == a_Age)
{
WorldAge.m_NumCyclesSame += 1;
- if (WorldAge.m_NumCyclesSame > (1000 * m_IntervalSec) / CYCLE_MILLISECONDS)
+ if (WorldAge.m_NumCyclesSame > (m_IntervalSec * 1000) / CYCLE_MILLISECONDS)
{
DeadlockDetected();
}