summaryrefslogtreecommitdiffstats
path: root/src/DeadlockDetect.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/DeadlockDetect.h
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to 'src/DeadlockDetect.h')
-rw-r--r--src/DeadlockDetect.h24
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);
} ;