Browse Source

Integrate deferred background processing into main OneService implementation.

pull/1/head
Adam Ierymenko 11 years ago
parent
commit
3e22fee842
  1. 8
      node/Node.hpp
  2. 4
      service/OneService.cpp

8
node/Node.hpp

@ -129,6 +129,14 @@ public:
// 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()
*/

4
service/OneService.cpp

@ -656,6 +656,10 @@ public:
}
}
// Start two background threads to handle expensive ops out of line
Thread::start(_node);
Thread::start(_node);
_nextBackgroundTaskDeadline = 0;
uint64_t clockShouldBe = OSUtils::now();
_lastRestart = clockShouldBe;

Loading…
Cancel
Save