diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-05 16:06:16 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-05 16:06:16 -0400 |
| commit | a7c4cbe53aad51b3e74fa9cb1af975cb8d356954 (patch) | |
| tree | e4578c51ea7239aeaf5dd6ebcaa844a0fb00f9ea /node/Topology.cpp | |
| parent | 3368330b777da9561539c04ea589aa7060e1d569 (diff) | |
| download | infinitytier-a7c4cbe53aad51b3e74fa9cb1af975cb8d356954.tar.gz infinitytier-a7c4cbe53aad51b3e74fa9cb1af975cb8d356954.zip | |
CLI debugging, got rid of nasty old Thread class and replaced with newer cleaner portable idiom.
Diffstat (limited to 'node/Topology.cpp')
| -rw-r--r-- | node/Topology.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/node/Topology.cpp b/node/Topology.cpp index 8487684e..ff012eaa 100644 --- a/node/Topology.cpp +++ b/node/Topology.cpp @@ -38,7 +38,6 @@ namespace ZeroTier { Topology::Topology(const RuntimeEnvironment *renv,const char *dbpath) throw(std::runtime_error) : - Thread(), _r(renv), _amSupernode(false) { @@ -55,7 +54,7 @@ Topology::Topology(const RuntimeEnvironment *renv,const char *dbpath) Utils::lockDownFile(dbpath,false); // node.db caches secrets - start(); + _thread = Thread<Topology>::start(this); } Topology::~Topology() @@ -68,10 +67,7 @@ Topology::~Topology() _peerDeepVerifyJobs.back().type = _PeerDeepVerifyJob::EXIT_THREAD; } _peerDeepVerifyJobs_c.signal(); - - while (running()) - Thread::sleep(10); // wait for thread to terminate without join() - + Thread<Topology>::join(_thread); KISSDB_close(&_dbm); } @@ -223,7 +219,7 @@ void Topology::clean() _peerDeepVerifyJobs_c.signal(); } -void Topology::main() +void Topology::threadMain() throw() { for(;;) { |
