summaryrefslogtreecommitdiffstats
path: root/src/DeadlockDetect.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-12-13 13:11:01 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-12-13 13:11:01 +0100
commit4b20a615192baeb5ef0a04a10161a03428cda8cd (patch)
treec6f25102267b0cc4a444f6e746679405948142b0 /src/DeadlockDetect.cpp
parentFixed compilation? (diff)
parentMerge pull request #1660 from Seadragon91/master (diff)
downloadcuberite-4b20a615192baeb5ef0a04a10161a03428cda8cd.tar
cuberite-4b20a615192baeb5ef0a04a10161a03428cda8cd.tar.gz
cuberite-4b20a615192baeb5ef0a04a10161a03428cda8cd.tar.bz2
cuberite-4b20a615192baeb5ef0a04a10161a03428cda8cd.tar.lz
cuberite-4b20a615192baeb5ef0a04a10161a03428cda8cd.tar.xz
cuberite-4b20a615192baeb5ef0a04a10161a03428cda8cd.tar.zst
cuberite-4b20a615192baeb5ef0a04a10161a03428cda8cd.zip
Diffstat (limited to 'src/DeadlockDetect.cpp')
-rw-r--r--src/DeadlockDetect.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/DeadlockDetect.cpp b/src/DeadlockDetect.cpp
index 7f703416c..3bb897221 100644
--- a/src/DeadlockDetect.cpp
+++ b/src/DeadlockDetect.cpp
@@ -13,7 +13,7 @@
-/// Number of milliseconds per cycle
+/** Number of milliseconds per cycle */
const int 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();
}