diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:45:45 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:50:18 +0100 |
commit | ca6ef58b1ee8521e4b940ee4883dee714960e413 (patch) | |
tree | 8532add455224b07c07a759e3d906f50c0695888 /src/DeadlockDetect.h | |
parent | Merge pull request #2972 from marvinkopf/PlayerAutoComplete (diff) | |
download | cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2 cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip |
Diffstat (limited to '')
-rw-r--r-- | src/DeadlockDetect.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/DeadlockDetect.h b/src/DeadlockDetect.h index 3d8e49a6d..39d3f8691 100644 --- a/src/DeadlockDetect.h +++ b/src/DeadlockDetect.h @@ -24,41 +24,41 @@ class cDeadlockDetect : public cIsThread { typedef cIsThread super; - + public: cDeadlockDetect(void); - + /** Starts the detection. Hides cIsThread's Start, because we need some initialization */ bool Start(int a_IntervalSec); - + protected: struct sWorldAge { /** Last m_WorldAge that has been detected in this world */ Int64 m_Age; - + /** Number of cycles for which the age has been the same */ int m_NumCyclesSame; } ; - + /** Maps world name -> sWorldAge */ typedef std::map<AString, sWorldAge> WorldAges; - + WorldAges m_WorldAges; - + /** Number of secods for which the ages must be the same for the detection to trigger */ int m_IntervalSec; - - + + // cIsThread overrides: virtual void Execute(void) override; - + /** Sets the initial world age */ void SetWorldAge(const AString & a_WorldName, Int64 a_Age); - + /** Checks if the world's age has changed, updates the world's stats; calls DeadlockDetected() if deadlock detected */ void CheckWorldAge(const AString & a_WorldName, Int64 a_Age); - + /** Called when a deadlock is detected. Aborts the server. */ NORETURN void DeadlockDetected(void); } ; |