diff options
author | madmaxoft <github@xoft.cz> | 2013-08-19 22:35:27 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-08-19 22:35:27 +0200 |
commit | 2d7c72f1b705560822b15f11208f1e5d6a735d86 (patch) | |
tree | d226b0e5de8ab1c43b00875d8b722f487ed60175 /source/DeadlockDetect.cpp | |
parent | Fixed WorldTickThread reporting wrong time durations for each tick. (diff) | |
download | cuberite-2d7c72f1b705560822b15f11208f1e5d6a735d86.tar cuberite-2d7c72f1b705560822b15f11208f1e5d6a735d86.tar.gz cuberite-2d7c72f1b705560822b15f11208f1e5d6a735d86.tar.bz2 cuberite-2d7c72f1b705560822b15f11208f1e5d6a735d86.tar.lz cuberite-2d7c72f1b705560822b15f11208f1e5d6a735d86.tar.xz cuberite-2d7c72f1b705560822b15f11208f1e5d6a735d86.tar.zst cuberite-2d7c72f1b705560822b15f11208f1e5d6a735d86.zip |
Diffstat (limited to 'source/DeadlockDetect.cpp')
-rw-r--r-- | source/DeadlockDetect.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/source/DeadlockDetect.cpp b/source/DeadlockDetect.cpp index 960038f81..de9a32d39 100644 --- a/source/DeadlockDetect.cpp +++ b/source/DeadlockDetect.cpp @@ -13,10 +13,10 @@ /// Number of milliseconds per cycle -const int CYCLE_MILLISECONDS = 500; +const int CYCLE_MILLISECONDS = 100; /// When the number of cycles for the same world age hits this value, it is considered a deadlock -const int NUM_CYCLES_LIMIT = 40; // 40 = twenty seconds +const int NUM_CYCLES_LIMIT = 200; // 200 = twenty seconds @@ -60,20 +60,10 @@ bool cDeadlockDetect::Start(void) -void cDeadlockDetect::Stop(void) -{ - m_EvtTerminate.Set(); - super::Stop(); -} - - - - - void cDeadlockDetect::Execute(void) { // Loop until the event is signalled - while (m_EvtTerminate.Wait(CYCLE_MILLISECONDS) == cEvent::wrTimeout) + while (!m_ShouldTerminate) { // Check the world ages: class cChecker : @@ -95,6 +85,8 @@ void cDeadlockDetect::Execute(void) } } Checker(this); cRoot::Get()->ForEachWorld(Checker); + + cSleep::MilliSleep(CYCLE_MILLISECONDS); } // while (should run) } |