summaryrefslogtreecommitdiff
path: root/node/Node.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-12 22:07:48 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-12 22:07:48 -0400
commitaa59c1de10b53df8a33d1df99b74b8a20052b9af (patch)
treea1aa60edf84de6ef944ac609656bd24bd73452aa /node/Node.cpp
parenta0048785465eb14356c1cb185c271c223862491c (diff)
downloadinfinitytier-aa59c1de10b53df8a33d1df99b74b8a20052b9af.tar.gz
infinitytier-aa59c1de10b53df8a33d1df99b74b8a20052b9af.zip
Bunch of little bug fixes in newly refactored code.
Diffstat (limited to 'node/Node.cpp')
-rw-r--r--node/Node.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index 4b5a43ed..976de742 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -399,7 +399,7 @@ Node::ReasonForTermination Node::run()
try {
unsigned long delay = std::min((unsigned long)ZT_MIN_SERVICE_LOOP_INTERVAL,_r->sw->doTimerTasks());
uint64_t start = Utils::now();
- Thread::sleep(delay);
+ _r->mainLoopWaitCondition.wait(delay);
lastDelayDelta = (long)(Utils::now() - start) - (long)delay;
} catch (std::exception &exc) {
LOG("unexpected exception running Switch doTimerTasks: %s",exc.what());
@@ -426,12 +426,14 @@ void Node::terminate()
throw()
{
((_NodeImpl *)_impl)->terminateNow = true;
+ ((_NodeImpl *)_impl)->renv.mainLoopWaitCondition.signal();
}
void Node::updateStatusNow()
throw()
{
((_NodeImpl *)_impl)->updateStatusNow = true;
+ ((_NodeImpl *)_impl)->renv.mainLoopWaitCondition.signal();
}
class _VersionStringMaker