mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Integrate deferred background processing into main OneService implementation.
This commit is contained in:
parent
5ec5911e1b
commit
3e22fee842
2 changed files with 12 additions and 0 deletions
|
@ -129,6 +129,14 @@ public:
|
||||||
|
|
||||||
// Internal functions ------------------------------------------------------
|
// Internal functions ------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience threadMain() for easy background thread launch
|
||||||
|
*
|
||||||
|
* This allows background threads to be launched with Thread::start
|
||||||
|
* that will run against this node.
|
||||||
|
*/
|
||||||
|
inline void threadMain() throw() { this->backgroundThreadMain(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Time as of last call to run()
|
* @return Time as of last call to run()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -656,6 +656,10 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start two background threads to handle expensive ops out of line
|
||||||
|
Thread::start(_node);
|
||||||
|
Thread::start(_node);
|
||||||
|
|
||||||
_nextBackgroundTaskDeadline = 0;
|
_nextBackgroundTaskDeadline = 0;
|
||||||
uint64_t clockShouldBe = OSUtils::now();
|
uint64_t clockShouldBe = OSUtils::now();
|
||||||
_lastRestart = clockShouldBe;
|
_lastRestart = clockShouldBe;
|
||||||
|
|
Loading…
Add table
Reference in a new issue