summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceStorm/NodeI.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp/src/IceStorm/NodeI.cpp b/cpp/src/IceStorm/NodeI.cpp
index 695baac0b34..0c9511e1dfa 100644
--- a/cpp/src/IceStorm/NodeI.cpp
+++ b/cpp/src/IceStorm/NodeI.cpp
@@ -203,6 +203,13 @@ NodeI::start()
// By setting _checkTask first we stop recovery() from setting it
// to the regular election interval.
//
+
+ //
+ // We use this lock to ensure that recovery is called before CheckTask
+ // is scheduled, even if timeout is 0
+ //
+ Lock sync(*this);
+
_checkTask = new CheckTask(this);
_timer->schedule(_checkTask, IceUtil::Time::seconds((_nodes.size() - _id) * 2));
recovery();