summaryrefslogtreecommitdiffstats
path: root/source/DeadlockDetect.h
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2013-12-09 18:51:12 +0100
committerworktycho <work.tycho@gmail.com>2013-12-09 18:51:12 +0100
commit843605d59ebc128be0a578dc6f45ef8c05da6e79 (patch)
tree3ffebc6ba27baf7a9e1d4bc51501ffeea9b14226 /source/DeadlockDetect.h
parentmerged makefile changes (diff)
parentFix Undefined behavior at Bindings/LuaWindow line 32 (diff)
downloadcuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.gz
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.bz2
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.lz
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.xz
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.zst
cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.zip
Diffstat (limited to 'source/DeadlockDetect.h')
-rw-r--r--source/DeadlockDetect.h65
1 files changed, 0 insertions, 65 deletions
diff --git a/source/DeadlockDetect.h b/source/DeadlockDetect.h
deleted file mode 100644
index 2559c3fff..000000000
--- a/source/DeadlockDetect.h
+++ /dev/null
@@ -1,65 +0,0 @@
-
-// DeadlockDetect.h
-
-// Declares the cDeadlockDetect class that tries to detect deadlocks and aborts the server when it detects one
-
-/*
-This class simply monitors each world's m_WorldAge, which is expected to grow on each tick.
-If the world age doesn't grow for several seconds, it's either because the server is super-overloaded,
-or because the world tick thread hangs in a deadlock. We presume the latter and therefore kill the server.
-Once we learn to write crashdumps programmatically, we should do so just before killing, to enable debugging.
-*/
-
-
-
-#pragma once
-
-#include "OSSupport/IsThread.h"
-
-
-
-
-
-class cDeadlockDetect :
- public cIsThread
-{
- typedef cIsThread super;
-
-public:
- cDeadlockDetect(void);
-
- /// Starts the detection. Hides cIsThread's Start, because we need some initialization
- bool Start(void);
-
-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;
-
-
- // 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.
- void DeadlockDetected(void);
-} ;
-
-
-
-